This tutorial shows how to send a single form field/input of a form. We are going to use jQuerys ajax features to do that.
First you need a form and don't forget to include jQuery library.
Source code viewer
<form action="form_action.php" id="form-id" method="post"> <input type="submit" value="Submit" /> </form>Programming Language: HTML
If you leave a text field the blur funtion of jquery will occur. You can do some really cool things with it. For an example send the field data to your server.
Source code viewer
<script type="text/javascript"> // jquery page ready function $().ready(function(){ //do the funcion when you leave an input field(press tab or leave active textbox by mouse click) $("form#form-id > input, textarea, select").blur(function() { //send data using post $.post( //url where the post will be sent "form_action.php", //data whitch will be sent $(this), //this funcion is will be called on return, here we make an alert whitch contains retured data function(data){alert(data);} } }); }); </script>Programming Language: Javascript