Submitting Forms with AJAX
serialize turns form fields into a query string. Send it with $.post and prevent the normal submit.
Example
$('form').on('submit', function (e) {
e.preventDefault();
$.post('/save', $(this).serialize()).done(function () {
$('#msg').text('Saved');
});
});Exercise
Turn fields into a string.
$(this).()
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.