Validate field1 greater than field2
How do I validate that the values in field1 must be greater that the values in field2?
I can't find a way to accomplish this. Thanx for any help.
How do I validate that the values in field1 must be greater that the values in field2?
I can't find a way to accomplish this. Thanx for any help.
use numeric validation. For the maximum number, enter the following code:
<?php echo((isset($_POST["field2"]))?$_POST["field2"]:"") ?>
assuming the name of the filed is field2
Thx Jason.
I'm using the following code:
if ("" == "") {
$WAFV_Redirect = "res_formular1.php?ERROR=8&Sitzungszimmer=".$_SESSION['sessSitzungszimmer']."&Datum=".$_SESSION['sessDatum']."&Dauer=".$_SESSION['sessDauer']."&Bestuhlung=".$_SESSION['sessBestuhlung']."&EventVon=".$_SESSION['sessEventVon']."&EventBis=".$_SESSION['sessEventBis']."";
$_SESSION['WAVT_resformular2_612_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateNM(((isset($_POST["EventVon"]))?$_POST["EventVon"]:"") . "",0,((isset($_POST["EventBis"]))?($_POST["EventBis"]-15):""),"",",.",true,4);
if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"resformular2_612");
}
}
So the validation takes place before the page loads, this works. But If I submit the form the validation runs again and redirects to the first page.
the validation shouldn't happen on page load, it happen when the form submits.
I've got 2 pages, the 1st with the formular fields and the second as a control page where the insert behaviour are located. Now I use the submit trigger (InfraparkReservation_submit) from the first page but it still doesn't accept submitting the form on the 2nd page:
if ((((isset($_POST["InfraparkReservation_submit"]))?$_POST["InfraparkReservation_submit"]:"") != "")) {
$WAFV_Redirect = "res_formular1.php?ERROR=8&Sitzungszimmer=".$_SESSION['sessSitzungszimmer']."&Datum=".$_SESSION['sessDatum']."&Dauer=".$_SESSION['sessDauer']."&Bestuhlung=".$_SESSION['sessBestuhlung']."&EventVon=".$_SESSION['sessEventVon']."&EventBis=".$_SESSION['sessEventBis']."";
$_SESSION['WAVT_resformular2_321_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateNM(((isset($_POST["EventVon"]))?$_POST["EventVon"]:"") . "",0,((isset($_POST["EventBis"]))?($_POST["EventBis"]-15):""),"",",.",true,5);
if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"resformular2_321");
}
}
The two submit buttons have the same name "InfraparkReservation_submit". Does that matter?
yes, the submit buttons should use unique names.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.