<script>
function signUp()
{
$.post("accept.php", $("#newUserReg").serialize(),
function(data){
alert(data);
}, "json");
}
</script>
İşte html formudur:
<form id = "newUserReg" name = "newUserReg" onsubmit() = "signUp(); return false;">
<input id = "newField1" type = "text" />
<input id = "newField2" type = "password" name = "newPwd" />
<input type = "submit" />
</form>
Accept.php:
if(isset($_POST['newField1']))
echo json_encode("adas");
else
echo json_encode("adaasds");