SHARE
TWEET

jQuery script to hide certain form fields

a guest Feb 21st, 2012 19,394 Never
  1. /*! jQuery script to hide certain form fields */
  2.  
  3. $(document).ready(function() {
  4.  
  5.         //Hide the field initially
  6.         $("#hide1").hide();
  7.  
  8.         //Show the text field only when the third option is chosen - this doesn't
  9.         $('#awesome').change(function() {
  10.                 if ($("#awesome").val() == "Nope") {
  11.                         $("#hide1").show();
  12.                 }
  13.                 else {
  14.                         $("#hide1").hide();
  15.                 }
  16.         });
  17. });
RAW Paste Data
Top