The user must select a date from the dropdown.PHP Code:<?php
echo "Expiration Date:<br />";
echo"<label for='month'>Month: </label>";
echo"<select id='month' name='eMonth'>";
$month2=array("Jan"=>"1","Feb"=>"2","Mar"=>"3","Apr"=>"4","May"=>"5","Jun"=>"6","Jul"=>"7","Aug"=>"8","Sep"=>"9","Oct"=>"10","Nov"=>"11","Dec"=>"12");
foreach( $month2 as $name2 => $num){
echo '<option value="'.$num.'">'.$name2.'</option>';
}
echo"</select>";
echo"<label for='date'>day </label>";
echo"<select id='date' name='eDay'>";
for($j=1; $j<=31; $j++)
{
echo '<option>'.$j.'</option>';
}
echo"</select>";
echo "<label for='year'>Year: </label>";
echo"<select id='year' name='eYear'>";
for($l=2008; $l<=2038; $l++)
{
$cyr=date('Y');
if($l==$cyr){
echo '<option value="'.$l.'" selected="selected">'.$l.'</option>';
} else{
echo '<option>'.$l.'</option>';
}
}
echo"</select><br>";
?>
I need to display an alert message "error" when the user selects
jul 21, 2008 in the dropdown and the date today is aug 21, 2008
or the when the user selects the date that is less than the date today.
the user must select a date that is greater than the date today.
could you please help me?



Reply With Quote

Bookmarks