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

  • Home
  • SEARCH
  • 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

I have created a PHP-script to update a web server that is live inside
I've created a few autorun script files on various USB devices that run bash
I have created a JavaScript application that requires all images to be preloaded first.
I want to create a script that parses or makes sense of apache's error
I need to create a script that automatically setup a ssh tunnel. I think
I'm using SQL*Plus 9.2 on Oracle 10g enterprise. I have created some scripts that
I have a bash script that creates a Subversion patch file for the current
I have written a CGI script that creates an image dynamically using GET data.
Using Windows 2003, I'm look for a way to create a logoff script that
I'm using a build script that calls Wise to create some install files. The

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.