Pokaże to na przykładzie:
Kod
<html>
<head>
<script type="text/language" src="mintAjax.js"></script>
<script type="text/language">
var req = mint.Ajax;
req.OnSuccess = function()
{
if(req.responseText == "")
{
return true;
}
else
{
return false;
}
}
req.Send("jakis_plik.php");
</script>
</head>
<body>
<?php
switch($_POST['step'])
{
case 1:
?>
<form action="" method="post" onSubmit="return Next()">
<input type="text" name="name" id="name"><br>
<input type="hidden" name="step" value="2">
<input type="submit" value="Dalej">
</form>
<?php
break;
case 2:
drugi formularz
break;
}
?>
</body>
</html>
I chodzi o to że jak responseText będzie pusty czy pełny to i tak wyświetli się drugi formularz.