Reputation: 3
I want to manipulate form data with jQuery before I submit a form. The code looks like this:
$('form').submit(function(){
event.preventDefault()
console.log('Something');
// What do I put here to make the form submit?
})
Upvotes: 0
Views: 36
Reputation: 543
In the hypotesis you have a submit input in the form, you can try this:
$('form input[type=submit]').on('click', function(event){
event.preventDefault()
console.log('Something');
// make the form submit
$(this).parents('form').submit();
})
Upvotes: 1