From d5c93dbb7234b2b2eba7ad2cd2523a47775b910e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Barrois?= Date: Sun, 6 Mar 2011 01:19:18 +0100 Subject: [PATCH] Add visual hint for 'no company search for referents" (Closes #1378) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Raphaël Barrois --- templates/search/adv.form.tpl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/templates/search/adv.form.tpl b/templates/search/adv.form.tpl index ecc0301..1ea13ac 100644 --- a/templates/search/adv.form.tpl +++ b/templates/search/adv.form.tpl @@ -113,6 +113,15 @@ }); } + // when checking/unchecking "only_referent", disable/enable some fields + function changeOnlyReferent() { + if ($("#only_referent").is(':checked')) { + $("input[name='entreprise']").attr('disabled', true); + } else { + $("input[name='entreprise']").removeAttr('disabled'); + } + } + // when choosing a job term in tree, hide tree and set job term field function searchForJobTerm(treeid, jtid, full_name) { $(".term_tree").remove(); @@ -224,6 +233,10 @@ // to ensure that, we unset it $(this).parent().find('.autocompleteTarget').val(''); }); + + $("#only_referent").change(function() { changeOnlyReferent(); }); + changeOnlyReferent(); + }); /** Regexps to wipe out from search queries */ var default_form_values = [ /&woman=0(&|$)/, /&subscriber=0(&|$)/, /&alive=0(&|$)/, /&egal[12]=[^&]*&promo[12]=(&|$)/g, /&networking_type=0(&|$)/, /&[^&=]+=(&|$)/g ]; -- 2.1.4