form submit in jquery code example

Example 1: jQuery AJAX form submit

// jQuery ajax form submit example, runs when form is submitted
$("#myFormID").submit(function(e) {
    e.preventDefault(); // prevent actual form submit
    var form = $(this);
    var url = form.attr('action'); //get submit url [replace url here if desired]
         type: "POST",
         url: url,
         data: form.serialize(), // serializes form input
         success: function(data){

Example 2: jquery submit form

// It is simply

// However, you're most likely wanting to operate on the form data
// So you will have to do something like the following...
	// Stop the form submitting
  	// Do whatever it is you wish to do
  	// Now submit it 
    // Don't use $(this).submit() FFS!
  	// You'll never leave this function & smash the call stack! :D

Example 3: when a form is subbmited jquery

$("#myform").submit(function(e) {

Example 4: jquery submit form

<input type='button' value='Submit form' onClick='submitDetailsForm()' />

<script language="javascript" type="text/javascript">
    function submitDetailsForm() {

Example 5: ajax post form listener button

$("button").click(function(e) {
        type: "POST",
        url: "/pages/test/",
        data: { 
            id: $(this).val(), // < note use of 'this' here
            access_token: $("#access_token").val() 
        success: function(result) {
        error: function(result) {