Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 123305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T04:15:56+00:00 2026-05-11T04:15:56+00:00

I created a script that requires selecting a beginning year then only displays years

  • 0

I created a script that requires selecting a beginning year then only displays years from that Beginning year -> 2009. It’s just a startYear to endYear Range selector.

The script only works in firefox. I’m LEARNING javascript, so I’m hoping someone can point me into the right direction. Live script can be found at http://motolistr.com

<script type='text/javascript'> function display_year2(start_year) { //alert(start_year); if (start_year != 'Any') {     var i;     for(i=document.form.year2.options.length-1;i>=0;i--)     {         document.form.year2.remove(i);     }      var x = 2009;     while (x >= start_year) {         var optn = document.createElement('OPTION');         optn.text = x;         optn.value = x;         document.form.year2.options.add(optn);         //alert(x);         x--;     } } else  {     var i;     for(i=document.form.year2.options.length-1;i>=0;i--)     {         document.form.year2.remove(i);     }     var optn = document.createElement('OPTION');     optn.text = 'Any';     optn.value = 'Any';     document.form.year2.options.add(optn); } // end else } // end function </script> 

Any ideas?

Thanks, Nick

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T04:15:56+00:00Added an answer on May 11, 2026 at 4:15 am

    You are trying to set an onclick event on each option. IE does not support this. Try using the onchanged event in the select element instead.

    Instead of this:

    <select name='year1' id='year1'>     <option value='Any' onclick='javascript:display_year2('Any');' >Any</option>     <option value='2009' onclick='javascript:display_year2(2009);' >2009</option>     <option value='2008' onclick='javascript:display_year2(2008);' >2008</option> </select> 

    Try this:

    <select name='year1' id='year1' onchange='javascript:display_year2(this.options[this.selectedIndex].value)'>     <option value='Any'>Any</option>     <option value='2009'>2009</option>     <option value='2008'>2008</option> </select> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im using a jquery script that grabs my posts from facebook and then displays
I created a script that list the directories in the current directory <?php $dir
I have created a script that saves some files in the Documents directory of
I have created a script that will upload files to a general uploads folder,
I have created a Greasemonkey script that runs fine in the firebug editor, with
I have created an R script that it needs to load some libraries first.
I have created one ruby script that I want to run with some flags
I have a file that is created by a script that is run during
Using Tinybutstrong and openTBS i created a script in PHP that opens multiple docx
I have a script task that executes a dynamically created SQL restore statement. This

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.