This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
    Bookmark Topic Watch Topic
  • New Topic

How to add year in select

 
Vaishali Paramane
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi this is my first program in javascript.

I want to add year dynamically in select option. I wrote following code but it is not working.
Register.html

 
amit punekar
Ranch Hand
Posts: 544
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hello,
document.Register.year.options[selectLength] = newOpt;


There is no form named "Register".

Regards,
Amit
 
Goutam Chowdhury
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Report post to moderator
 
Vaishali Paramane
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Report post to moderator
Thanks

This is working but only it adds 1900 one number.

document.Register.year.options[selectLength ] = newOpt;
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Report post to moderator
because selectLenght is never updated with the new length.
 
Vaishali Paramane
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Report post to moderator
Thanks

Now it is working
 
Vaishali Paramane
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Report post to moderator
Now I am having problem when I am using tag library


How to use name attribute to work javascript code?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65218
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please ask new question in new topics.
 
    Bookmark Topic Watch Topic
  • New Topic