Connecting Tech Pros Worldwide Help | Site Map

dynamic listbox - populate with month/year

  #1  
Old August 28th, 2008, 03:51 AM
Newbie
 
Join Date: Aug 2008
Posts: 4
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]

Last edited by gits; August 28th, 2008 at 08:44 AM. Reason: added code tags
  #2  
Old August 28th, 2008, 03:57 AM
Newbie
 
Join Date: Aug 2008
Posts: 4

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">

  #3  
Old August 28th, 2008, 05:20 AM
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,492
Provided Answers: 10

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()).
  #4  
Old August 28th, 2008, 08:38 AM
Newbie
 
Join Date: Aug 2008
Posts: 4

re: dynamic listbox - populate with month/year


your post code example, please. I can't coding
Thanks you,
  #5  
Old August 28th, 2008, 08:42 AM
gits's Avatar
Moderator
 
Join Date: May 2007
Location: Munich, Germany
Posts: 4,102
Provided Answers: 1

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
  #6  
Old August 28th, 2008, 08:45 AM
gits's Avatar
Moderator
 
Join Date: May 2007
Location: Munich, Germany
Posts: 4,102
Provided Answers: 1

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
  #7  
Old August 28th, 2008, 09:51 AM
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,492
Provided Answers: 10

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 Threads
Thread Thread Starter Forum Replies Last Post
dynamic drop downs igotyourdotnet answers 4 December 8th, 2006 08:25 AM