I'm calling the click event with <button type="action" value="click"></button> to submit a form with Ajax. To submit form with button type submit works if I don't call the click event. So you can eliminate this possibility. I just need to call the submit function with click event which I doubt I've proceed it right.
The buggy code example:
// On document ready
$(function() {
$('#update-button').click(function(){
$('#update-cart').submit(function(ev) {
// Prevent the form from actually submitting
ev.preventDefault();
// Get the post data
var data = $(this).serialize();
// Send it to the server
$.post('/', data, function(response, textStatus, jqXHR) {
if (response.success) {
// YES
} else {
// Ooo NO
}
});
});
});
});
#update-button, what it does it bind an submit event to#update-cart. Also I don't thinktype="action"is valid HTML. You probably wanttype="submit"ortype="button".id="update-button". So You can post the answer. I'm glad you've helped! ;)