dynamic listbox - populate with month/year 
August 28th, 2008, 02:51 AM
| | Newbie | | Join Date: Aug 2008
Posts: 4
| | 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
| 
August 28th, 2008, 02:57 AM
| | Newbie | | Join Date: Aug 2008
Posts: 4
| | 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"> | 
August 28th, 2008, 04:20 AM
|  | Moderator | | Join Date: Aug 2008 Location: Leipzig, Germany Age: 32
Posts: 2,209
| |
Well, in this case I recommend using the appendChild() function in combination with the Date object (getMonth(), getYear()).
| 
August 28th, 2008, 07:38 AM
| | Newbie | | Join Date: Aug 2008
Posts: 4
| |
your post code example, please. I can't coding
Thanks you,
| 
August 28th, 2008, 07:42 AM
|  | Moderator | | Join Date: May 2007 Location: Munich, Germany Age: 37
Posts: 3,780
| |
changed thread title ... please always use a meaningful thread title according to the posting guidelines
kind regards
MOD
| 
August 28th, 2008, 07:45 AM
|  | Moderator | | Join Date: May 2007 Location: Munich, Germany Age: 37
Posts: 3,780
| |
merged threads - please don't double post ... keep all posts related to one of your problems in one thread ...
kind regards
MOD
| 
August 28th, 2008, 08:51 AM
|  | Moderator | | Join Date: Aug 2008 Location: Leipzig, Germany Age: 32
Posts: 2,209
| | 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.
|  | | Thread Tools | Search this Thread | | | | | | | 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.
|