0

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?

Community
  • 1
  • 1
DEVOPS
  • 18,190
  • 34
  • 95
  • 118

3 Answers3

2

As always nettuts provide a great tutorial for this - Submit A Form Without Page Refresh using jQuery

Alex
  • 8,875
  • 2
  • 27
  • 44
2
$.ajax({
    type: 'post',
    url: 'servletToUSe',
    data: {
        "fieldValue": $('#fieldName').val()
    },
    success: function () {
        //response handler
    }
thecodedeveloper.com
  • 3,220
  • 5
  • 36
  • 67
Vinod R
  • 1,218
  • 10
  • 13
1

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.

thecodedeveloper.com
  • 3,220
  • 5
  • 36
  • 67
One Data Guy
  • 303
  • 1
  • 3
  • 8