Connecting Tech Pros Worldwide Forums | Help | Site Map

dynamic listbox - populate with month/year

Newbie
 
Join Date: Aug 2008
Posts: 4
#1: Aug 28 '08
i have created following drop down box for displaying year... i want to populate the drop down box upto current year.. and need to write a java script for this .. any pointers in this regard will be very helpful
Code: ( text )

[HTML]<select name=year>
<option value=2008>2008</option>
<option value=2007>2007</option>
<option value=2006>2006</option>
</select>[/HTML]
Newbie
 
Join Date: Aug 2008
Posts: 4
#2: Aug 28 '08

re: dynamic listbox - populate with month/year


i have created following drop down box for displaying month, year... i want to populate the drop down box upto current year.. and need to write a java script for this .. any pointers in this regard will be very helpful

" border="0">

Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,642
#3: Aug 28 '08

re: dynamic listbox - populate with month/year


Well, in this case I recommend using the appendChild() function in combination with the Date object (getMonth(), getYear()).
Newbie
 
Join Date: Aug 2008
Posts: 4
#4: Aug 28 '08

re: dynamic listbox - populate with month/year


your post code example, please. I can't coding
Thanks you,
gits's Avatar
Moderator
 
Join Date: May 2007
Location: Munich, Germany
Posts: 4,132
#5: Aug 28 '08

re: dynamic listbox - populate with month/year


changed thread title ... please always use a meaningful thread title according to the posting guidelines

kind regards
MOD
gits's Avatar
Moderator
 
Join Date: May 2007
Location: Munich, Germany
Posts: 4,132
#6: Aug 28 '08

re: dynamic listbox - populate with month/year


merged threads - please don't double post ... keep all posts related to one of your problems in one thread ...

kind regards
MOD
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,642
#7: Aug 28 '08

re: dynamic listbox - populate with month/year


Quote:

Originally Posted by olala123

your post code example, please. I can't coding
Thanks you,

I can't. I don't know your environment. The only thing I can do is guide you in learn coding yourself. So first I recommend reading a Javascript tutorial (see the "offsite links" (sticky post) at top of the Javascript forum). If you have problems understanding this or that topic, I'll be pleased to explain.
Reply


Similar JavaScript / Ajax / DHTML bytes