From: Raphaël Barrois Date: Sun, 26 Sep 2010 17:00:54 +0000 (+0200) Subject: Fix advanced search 'form cleanup' JS X-Git-Tag: xorg/1.0.1~145 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=e533246cb1d3b9a90534e2ae583d5fb019ff1b3a;p=platal.git Fix advanced search 'form cleanup' JS Signed-off-by: Raphaël Barrois --- diff --git a/templates/search/adv.form.tpl b/templates/search/adv.form.tpl index 3809b4d..a71dd30 100644 --- a/templates/search/adv.form.tpl +++ b/templates/search/adv.form.tpl @@ -210,11 +210,14 @@ var default_form_values = [ /&woman=0(&|$)/, /&subscriber=0(&|$)/, /&alive=0(&|$ function cleanForm(f) { var query = $(f).formSerialize(); var old_query; - for each (var reg in default_form_values) if (typeof(reg) != "undefined") { - do { - old_query = query; - query = query.replace(reg, '$1'); - } while (old_query != query); + for (var i in default_form_values) { + var reg = default_form_values[i]; + if (typeof(reg) != "undefined") { + do { + old_query = query; + query = query.replace(reg, '$1'); + } while (old_query != query); + } } query = query.replace(/^&*(.*)&*$/, '$1'); if (query == "rechercher=Chercher") {