clear form field after submitting form using ajax

How to clear form field after submitting form field in ajax

File name : index.php

$.ajax({
type:"POST",
url:formUrl,
data:formData,
beforeSend:function(){
$('.status').html('<b>Form is being submitted</b>');
},
success:function(data){
$('. status ').html('<b>Thank you!! We have received your form</b>');
},
complete:function(){
$('#form-id').each(function(){
this.reset(); //Here form fields will be cleared.
});
}
});





Previous Next


Trending Tutorials




Review & Rating

0.0 / 5

0 Review

5
(0)

4
(0)

3
(0)

2
(0)

1
(0)

Write Review Here