Add visual hint for 'no company search for referents" (Closes #1378)
authorRaphaël Barrois <raphael.barrois@polytechnique.org>
Sun, 6 Mar 2011 00:19:18 +0000 (01:19 +0100)
committerRaphaël Barrois <raphael.barrois@polytechnique.org>
Sun, 6 Mar 2011 00:19:18 +0000 (01:19 +0100)
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
templates/search/adv.form.tpl

index ecc0301..1ea13ac 100644 (file)
       });
   }
 
+  // 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();
           // 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 ];