index.php
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>test</title>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script>
/*
http://javascript.ru/forum/misc/62263-chto-pro-formy.html
*/
$(document).ready(function(){
$('#f1 [type=submit]').click(function(e){
e.preventDefault();
var str=$('#f1').serialize()+'&'+$('#f2').serialize();
$.ajax({
url: "server.php",
type: "post",
data: str,
success: function(html){
$("#result").html(html);
}
}).responseText;
});
});
</script>
</head>
<body>
<form id="f1" name="f1">
<input type="text" id="el1" name="el1" value="value1" />
<input type="text" id="el2" name="el2" value="value2" />
<input type="text" id="el3" name="el3" value="value3" />
<input type="submit" />
</form>
<form id="f2" name="f2">
<input type="text" id="el11" name="el11" value="value1" />
<input type="text" id="el22" name="el22" value="value2" />
<input type="text" id="el33" name="el33" value="value3" />
</form>
<div id="result"></div>
</body>
</html>
sever.php
<?php
$output='';
foreach($_POST as $key => $val){
$output.="$key = $val<br />";
}
echo 'На сервер поступили следующие данные:<br /><br />'.$output;
?>