It's pretty easy with
jQuery.
For example, with a form like this:
Code:
<form id="fmExample">
Text: <input type="text" id="txtText" name="txtText" value="">
Check: <input type="checkbox" id="chkCheck" name="chkCheck" value="1">
<select id="selSelect" name="selSelect">
<option value="0"> - Select - </option>
<option value="1">Dogs</option>
<option value="2">Cats</option>
</select>
<input type="submit" value="Submit">
</form>
You could post it via ajax to your server-side processing page with something like:
Code:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
$('#fmExample').submit(function(){
var objForm = $(this);
var form_values = objForm.serializeArray();
$.post('response.php', form_values, function(response){
$('<p>'+ response +'</p>').insertAfter(objForm);
});
return false;
});
});
</script>
Or for an even easier ride, and one that'll deal with stuff like file uploads, you could look at the jquery
form plugin.