Connecting Tech Pros Worldwide Help | Site Map

dynamic listbox - populate with month/year

 
LinkBack Thread Tools Search this Thread
  #1  
Old August 28th, 2008, 02:51 AM
Newbie
 
Join Date: Aug 2008
Posts: 4
Default help me

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 07:44 AM. Reason: added code tags
Reply
  #2  
Old August 28th, 2008, 02:57 AM
Newbie
 
Join Date: Aug 2008
Posts: 4
Default 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">

Reply
  #3  
Old August 28th, 2008, 04:20 AM
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Age: 32
Posts: 2,209
Default

Well, in this case I recommend using the appendChild() function in combination with the Date object (getMonth(), getYear()).
Reply
  #4  
Old August 28th, 2008, 07:38 AM
Newbie
 
Join Date: Aug 2008
Posts: 4
Default

your post code example, please. I can't coding
Thanks you,
Reply
  #5  
Old August 28th, 2008, 07:42 AM
gits's Avatar
Moderator
 
Join Date: May 2007
Location: Munich, Germany
Age: 37
Posts: 3,780
Default

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

kind regards
MOD
Reply
  #6  
Old August 28th, 2008, 07:45 AM
gits's Avatar
Moderator
 
Join Date: May 2007
Location: Munich, Germany
Age: 37
Posts: 3,780
Default

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

kind regards
MOD
Reply
  #7  
Old August 28th, 2008, 08:51 AM
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Age: 32
Posts: 2,209
Default

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
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.