Submitting Ajax Form With SimpleModal (jQuery)
I have a form within a SimpleModal modal, but when I try to use serialize with jQuery, the form data is always blank. The form serialize works outside of the modal, so theres something preventing the serialize from grabbing the form data. This is the code I am using:
<div id="address_form" style="display:none">
<div id="contact-area">
<form id="address_form" action="submit" method="POST"开发者_如何学Go>
<label for="Street">Street:</label>
<input type="text" name="Street" id="street" />
<input type="submit" name="submit" class="submit-button" />
</form>
</div>
</div>
$("#address_form").submit(function(){
var data = $(this).serialize();
alert(data)
return false;
});
You have two elements with the id of address_form
. Change the id on the DIV with that id and it will work.
精彩评论