Possible Duplicate:
submit a form using jquery
Hello friends
How can I submit a form using jquery. My form contain one file field also how can I post my form with out reloading the whole page. Any body can help me with some sample code?
Possible Duplicate:
submit a form using jquery
Hello friends
How can I submit a form using jquery. My form contain one file field also how can I post my form with out reloading the whole page. Any body can help me with some sample code?
As always nettuts provide a great tutorial for this - Submit A Form Without Page Refresh using jQuery
$.ajax({
type: 'post',
url: 'servletToUSe',
data: {
"fieldValue": $('#fieldName').val()
},
success: function () {
//response handler
}
Probably the simplest way is to use jQuery Form plugin, which can be found on http://jquery.malsup.com/form/
Then in the simplest option you just need to put below mention code:
$(document).ready(function () {
$('#your_form_id').ajaxForm();
});
See the plugin's documentation for further details.