PDA

View Full Version : Simple dropdown menu dinamic default value... any help!?



freddygusto
03-20-2008, 11:59 AM
Hello people,
I have two dropdown menus with the month and year respectively. I would like to set the default month and year options to the current date at every moment.
I guess we can call it a dynamic default value or something.
CODE:
<li>Select the Date
<select name="date">
<option>Jan</option>
<option>Feb</option>
<option>Mar</option>
<option>Apr</option>
<option>May</option>
<option>Jun</option>
<option>Jul</option>
<option>Aug</option>
<option>Sep</option>
<option>Oct</option>
<option>Nov</option>
<option>Dec</option>
</select>
<select name="year">
<option>2008</option>
<option>2007</option>
<option>2006</option>
<option>2005</option>
<option>2004</option>
<option>2003</option>
<option>2002</option>
<option>2001</option>
</select>

I hope it is possible to do this with js. Can you please help me out???
Cheers
Fred

vikram.raste
03-20-2008, 12:24 PM
http://www.javascriptkit.com/script/script2/curdateform2.shtml