|
Posted by Jonathan N. Little on 01/10/07 02:25
fun2trash@gmail.com wrote:
> Hi,
>
> I would like to be able to display the actual values of a variables (or
> in other words, populate) the options for the drop down box.
>
> For example: I would like to define a variable yesterday and today.
> Then, I would like to display the yesterday's date and today's date on
> the dropdown box. Of course, by tomorrow, the options should change.
> Is this possible?
>
> To clarify further, today would be 1-9-2007 and yesterday would be
> 1-8-2007. So, I would like a dropdown box that displays those dates
> today. However, by tomorrow, the dropdown box should display 1-9-2007
> for yesterday and then 1-10-2007 for today.
Need scripting. Here is a PHP solution
<select name="appointment">
<?php
$numberOfDay=10; //set as required
for($i=0; $i<$numberOfDay; $i++){
$theDate=date('m-d-Y', strtotime("+$i Days"));
echo "<option value=\"$theDate\">$theDate</option>";
}
?>
</select>
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Navigation:
[Reply to this message]
|