I have a popup div containing a form that when closed i would like the form to reset the errors and the fields within the form. I was planning on resetting the form in the disablePopup function. Other things to note is that it is a django project and i am using ajax to submit the form.
here is the code so far:
function disablePopup($contact_selector){
//disables popup only if it is enabled
if(popupStatus==1){
$("#backgroundPopup").fadeOut("fast");
$contact_selector.fadeOut("fast");
popupStatus = 0;
}
}
so basically I would like to extend this code to allow me to reset a form within the contact_selector
any ideas would be much appreciated
thank you
katie
edit:
I think what is happening is that my django errorlist is appearing in the html and is separate from the form validation. What I would like to do is initialize a new form to my django project when i close the div – not just reset the form i have. that way when the open the form again the data is clean with no leftovers from their last entries
i ended up using the following code: