clearing the form element using jquery -
i have form id='form_testimonial'. here code clear form element
$(':input,:hidden','#form_testimonial') .not(':button, :submit, :reset') .val(''); it clear value input select option value too, don't want clear values of select option.
simply use this:
$('#form_testimonial input[type="text"]').val(''); if want include hidden inputs too:
$('#form_testimonial').find(input[type="text"],input[type="hidden"]').val(''); you can use:
$('#form_testimonial input').filter(function(){ return this.type == "hidden" || this.type == "text"; }).val('');
Comments
Post a Comment