/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/*** Clear Form elements - STARTS ***/ function clear_form_elements(ele) { //alert('tst'); $('.error').hide(); $('.common_error').html(''); $('.notifier').css('display','none'); $(ele).find(':input').each(function() { switch(this.type) { case 'password': case 'select-multiple': case 'select-one': case 'text': case 'textarea': $(this).val(''); break; case 'checkbox': case 'radio': this.checked = false; } });