Advertisement
Guest User

jQuery script to hide certain form fields

a guest
Feb 21st, 2012
24,668
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.36 KB | None | 0 0
  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. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement