Advertisement
davidemaggiorelli

hidefieldsScript.js

Apr 12th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.58 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.         $('#selection').change(function() {
  10.                 if ($("#selection").val() == "Milano") {
  11.                         $("#hide1").show();
  12.                 }
  13.                 else {
  14.                         $("#hide1").hide();
  15.                 }
  16.         });
  17. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement