Dear all,
I have a dropdown with various dates, I wish the user, when he slects a date get's a waring he is too late or too early (as the preiod for a set on certain days)
Pls find the formcode
When i used my old script I used this to "calculate
How to incorate this into one??
I have a dropdown with various dates, I wish the user, when he slects a date get's a waring he is too late or too early (as the preiod for a set on certain days)
Pls find the formcode
<div class="form_item">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: 150px;">Wedstrijddatum</label>
<select class="cf_inputbox validate-selection" id="select_1" size="1" title="Hier uw keuze maken" name="select_1">
<option></option>
<option value="31-01-10"'.(isset($_POST['Wedstrijddatum']) && $_POST['Wedstrijddatum'] == '31-01-10' ? ' selected' : '').'>31-01-10</option>
<option value="28-02-10"'.(isset($_POST['Wedstrijddatum']) && $_POST['Wedstrijddatum'] == '28-02-10' ? ' selected' : '').'>28-02-10</option>
<option value="28-03-10"'.(isset($_POST['Wedstrijddatum']) && $_POST['Wedstrijddatum'] == '28-03-10' ? ' selected' : '').'>28-03-10</option>
<option value="18-04-10"'.(isset($_POST['Wedstrijddatum']) && $_POST['Wedstrijddatum'] == '18-04-10' ? ' selected' : '').'>18-04-10</option>
<option value="16-05-10"'.(isset($_POST['Wedstrijddatum']) && $_POST['Wedstrijddatum'] == '16-05-10' ? ' selected' : '').'>16-05-10</option>
<option value="13-06-10"'.(isset($_POST['Wedstrijddatum']) && $_POST['Wedstrijddatum'] == '13-06-10' ? ' selected' : '').'>13-06-10</option>
<option value="18-07-10"'.(isset($_POST['Wedstrijddatum']) && $_POST['Wedstrijddatum'] == '18-07-10' ? ' selected' : '').'>18-07-10</option> </select>
<a class="tooltiplink" onclick="return false;"><img height="16" border="0" width="16" class="tooltipimg" alt="" src="components/com_chronocontact/css/images/tooltip.png"/></a>
<div class="tooltipdiv">Datum :: Kies datum</div>
</div>
<div class="cfclear">Β </div>
</div>
When i used my old script I used this to "calculate
$error = '';
if($_SERVER['REQUEST_METHOD'] == 'POST') //Validate form
function getTime($time)
{
$arr = explode("-", $time);
$time = mktime(0,0,0,$arr[1], $arr[0], $arr[2]);
return $time;
}
$date1 = getTime($_POST['Wedstrijddatum']);
$date2 = getTime(date("d-m-y"));
if((($date1-$date2))>28*3600*24) {
$ok = false;
$error .= '- U bent te vroeg met inschrijven!.<br />'; //too earlie
}
if((($date1-$date2))<5*3600*24) {
$ok = false;
$error .= '- U bent te laat met inschrijven!.<br />';//too late
}
How to incorate this into one??