I have an add form inside a div which has 3-5 textboxes.. I submit the form via ajax and hide the div in the success function of it… Now i want to clear all the values of textboxes within the adddiv using jquery?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If they’re just text boxes (<input type=”text”> fields), then $(“form :input”).val(“”); would be the easiest way. If you have multiple types of inputs, though, you should check this out.
http://www.learningjquery.com/2007/08/clearing-form-data
It walks through how to create a plugin for clearing forms.