Hi all,
I use a neat little JS I found on the web to allow users of a site we made to select a date for their arrival and departure in a hotel from a popup calendar. The date they pick appears in formatted text-form in the fields of the form. You can check it out here: http://www.cityhousinggroup.com/rese...ex.php?lang=en
All of this works perfect, but I wonder if there is a way to make sure the date entered in the departure-field is a LATER date than the one selected in the arrival field.
This is the script I use: http://www.rainforestnet.com/datetimepicker.htm
Does anyone have an idea on how to validate the dates as I described? I use a PHP-form with this validation:
PHP Code:<?php
// Create an empty array to hold the error messages.
$arrErrors = array();
// Only validate if the Submit button was clicked.
if (!empty($_POST['Submit'])) {
// Each time there's an error, add an error message to the error array
// using the field name as the key.
if ($_POST['name']=='')
$arrErrors['name'] = 'enter your name';
if (count($arrErrors) == 0) {
// send the form
}
?>





Bookmarks