AJAX Form in a jQuery Popup - Need a way to clear content on popup close
I have a dynamic listing of products which is being pulled from a MySQL Database. On each one there is an option to "Contact Now" which leads to a jQuery Popup.
Now the form is being submitted via AJAX, here is the code for it. So when I click the "Send" button with no information, the error div shows up that says I need to fill out all fields.
If I close this popup and then go to another page and open up another brand, I get the same error message. So when I fill in the form successfully and get a Success Message, and clo开发者_如何学运维se the popup and open up a new brand the Success message shows, and I am unable to fill anything out until I refresh the page.
Does anyone have any ideas on how I could fix this?
Thanks!
On the event that triggers the close, clear the element containing the message. An example using jQuery is:
$("#closeButton").click(function() {
$("#errorMessage").hide();
});
精彩评论