Posted By

erraja_07 on 03/18/11


Tagged


Versions (?)

JQuery Clear Form Elements


 / Published in: JavaScript
 

  1. /*** Clear Form elements - STARTS ***/
  2. function clear_form_elements(ele) {
  3. //alert('tst');
  4. $('.error').hide();
  5. $('.common_error').html('');
  6. $('.notifier').css('display','none');
  7.  
  8. $(ele).find(':input').each(function() {
  9. switch(this.type) {
  10. case 'password':
  11. case 'select-multiple':
  12. case 'select-one':
  13. case 'text':
  14. case 'textarea':
  15. $(this).val('');
  16. break;
  17. case 'checkbox':
  18. case 'radio':
  19. this.checked = false;
  20. }
  21. });

Report this snippet  

You need to login to post a comment.