Ajax Tutorial
- What is Ajax
- How Ajax Work
- ajax() and load() Function
- AJAX get() and post() Methods
- AJAX Function
- Ajax Success
- Ajax Button Click
- Ajax div load on button click
- Insert Data
- Delete Data
- User Registration
- ContactUs Form
- Check existing Password in Ajax and change the Password
- Ajax Search
- Ajax Serialize Insert
- Ajax without Searialize Insert
- Ajax User Check Availability
- Ajax OptionBox
- Ajax Dropdown Session
- dynamic text box Add/Remove
- Star Rating
- Pin Check Available
- Ajax Programs
- Clear Form Field after submitting form
- Loader load show / hide
- Multiple Functions
Customer Say
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.
});
}
});