A few option spring to mind. First what about JavaScript ? its the quickest option, you can do it like this:
function val() {
if (document.formname.fieldname.value == "" |
document.formname.fieldname2.value == "") {
alert("You must all fields to continue.");
return false;
}
else {
return true;
}
}
<form name="formname" action="whatever.php" action="post" OnClick="return val();">
Change the 'fieldsname' and 'formname' to match yours.
An other option, if you dont what to use Javascript is this:
Check for empty values on the preview page like -
$err = "";
if ($POST["fieldname"] == "") { $err .=$POST["fieldname"] }
if ($POST["fieldname2"] == "") { $err .=$POST["fieldname2"] }
if ($err !=="")) {
// send the user back passing all the hidden values and the error variable
}
On the form look for the error variable and out put it, also pass the hidden values back into the form values.
HTH🙂