开发者

AJAX Form in a jQuery Popup - Need a way to clear content on popup close

开发者 https://www.devze.com 2023-04-12 16:57 出处:网络
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.

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(); 
});
0

精彩评论

暂无评论...
验证码 换一张
取 消