Hello,
I installed this Date Drop Down script and it works fine except it needs a couple of tweaks I can't seem to figure out:
1) I would like the box to have a default value such as "Select Day"
2) I can't seem to eliminate the spaces between the days when they view the days.
Any help would be appreciated. Gary
To View:
http://www.tnevni.com/4_timber_ridge_lane/schedule.php
<?php
call_user_func ('DateDropDown');
function DateDropDown($size=30,$default="DropDate") {
// $size = the number of days to display in the drop down
// $default = Todays date in m:d:Y format (SEE DATE COMMAND ON WWW.PHP.NET)
// $skip = if set then the program will skip Sundays and Saturdays
$skip=1;
echo "<select name=dropdate STYLE=\"font-family: monospace;\">";
for ($i = 0; $i <= $size; $i++) {
$theday = mktime (0,0,0,date("m") ,date("d")+$i ,date("Y"));
$option=date("D M j, Y",$theday);
$value=date("m:d:Y",$theday);
$dow=date("D",$theday);
if ($dow=="Sun") {
echo "<option disabled> </option>";
}
if ($value == $default) {
$selected="SELECTED";
} else {
$selected="";
}
if (($dow!="Sun" and $dow!="Sat" and $dow!="Tue" and $dow!="Wed" and $dow!="Thu" and $dow!="Fri") or !$skip) {
echo "<option value=\"$value\" $selected>$option</option>";
}
}
echo "</select>";
}
?>