This requires a bit of modification on your part. You will have to change the min date to be changed dynamically based on the first form field. What I would recommend doing is to set some placeholder text into the min date field, so you can tell where in the code you need to make the change. In this example I used "aaaaaaaaaaaaaaa". I have applied date validation on the 2 fields, on the second one I have added the placeholder min date text. The validation code added looks similar to this:
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$WAFV_Redirect = "";
$_SESSION['WAVT_untitled2_264_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateDT(((isset($_POST["textfield"]))?$_POST["textfield"]:"") . "",true,".*","","",false,".*","","",true,1);
$WAFV_Errors .= WAValidateDT(((isset($_POST["textfield2"]))?$_POST["textfield2"]:"") . "",true,".*","aaaaaaaaaaaaaaa","",false,".*","","",true,2);
if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"untitled2_264");
}
}
?>
You would want to make modifications so the code looks like this:
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$WAFV_Redirect = "test.php";
$_SESSION['WAVT_untitled2_264_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateDT(((isset($_POST["textfield"]))?$_POST["textfield"]:"") . "",true,".*","","",false,".*","","",true,1);
$WAFV_Errors .= WAValidateDT(((isset($_POST["textfield2"]))?$_POST["textfield2"]:"") . "",true,".*",((isset($_POST["textfield"]))?$_POST["textfield"]:""),"",false,".*","","",true,2);
if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"untitled2_264");
}
}
?>
Basically what I have done is to check the value that was posted in the first checkbox and checked it against the one input in the second checkbox. To do this, I have replaced the "aaaaaaaaaaaaaaa" with ((isset($_POST["textfield"]))?$_POST["textfield"]:"")