Posted By

landonmiller on 01/21/10


Tagged

forms jquery


Versions (?)

Display hidden textfield


 / Published in: jQuery
 

  1. //If div isn't empty, display div2.
  2. $('#div').keyup(function () {
  3. if ($(this).val()) {
  4. $("#div2:hidden").show();
  5. $('#div2').addClass('inputclass pageRequired');
  6. } else {
  7. $('label[for=test]').hide();
  8. $('#div2:visible').removeClass('inputclass pageRequired');
  9. $("#div2:visible").hide()
  10. }
  11. });

Report this snippet  

You need to login to post a comment.