jQuery to perform ajax request from form upon submission? -


what jquery use (check , then) send contents of simple form php form using ajax?

the form collects address , server send email , confirm success of operation.

depending on needs, $.ajax() method litte more versatile $.post()..

you can dynamically define whether or not want use or post method...

an example website below:

$.ajax({    type: "post",    url: "some.php",    data: "name=john&location=boston",    success: function(msg){      alert( "data saved: " + msg );    }  }); 

where data can info form , msg response data request :)

to attach submit button click event, put above code within function:

$('#submitbutton').click(function () {   // ajax code here }); 

read more here: http://api.jquery.com/jquery.ajax/

hope helps :)


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -