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 8522473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:07:44+00:00 2026-06-11T07:07:44+00:00

new to JavaScript seeking some help. I have a form with a select drop

  • 0

new to JavaScript seeking some help. I have a form with a select drop down with 5 options.

Option1
Option2
option3
Option4
Option5′

I need to have the form to redirect to another url if any of the options are selected apart from Option 1 which should be the default one on page load.

Thank you in advance

I only used the following

<form action="" id="main" name="main" method="get" onChange="top.location.href=this.options[this.selectedIndex].value;" value="GO">

<select id="Region" name="Region" tabindex="7">
   <option value="/url">Option1</option>
   <option value="/url">Option2</option>
   <option value="/url">Option3</option>
   <option value="/url>Option4</option>
   <option value="" selected="selected">Option5</option>'
</select>
  • 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. Editorial Team
    Editorial Team
    2026-06-11T07:07:46+00:00Added an answer on June 11, 2026 at 7:07 am

    Just use a onchnage Event for select box.

    <select id="selectbox" name="" onchange="javascript:location.href = this.value;">
        <option value="https://www.yahoo.com/" selected>Option1</option>
        <option value="https://www.google.co.in/">Option2</option>
        <option value="https://www.gmail.com/">Option3</option>
    
    </select>
    

    And if selected option to be loaded at the page load then add some javascript code

    <script type="text/javascript">
        window.onload = function(){
            location.href=document.getElementById("selectbox").value;
        }       
    </script>
    

    for jQuery: Remove the onchange event from <select> tag

    jQuery(function () {
        // remove the below comment in case you need chnage on document ready
        // location.href=jQuery("#selectbox").val(); 
        jQuery("#selectbox").change(function () {
            location.href = jQuery(this).val();
        })
    })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I`m new to JavaScript and I need some help extracting the ID from URL
I have read many StackOverflow questions on the javascript new Date() object when it
I'm fairly new to JavaScript/jQuery/AJAX, so I suspect the issue is some typo I'm
I've created some hidden drop-down fields that I'm attempting to keep hidden until appropriately
I'm new to stackoverflow and HTML/CSS/Javascript. I have four tabs and I want them
I'm new to JQuery/Javascript. Have a JSON object that contains an array of strings
I'm relatively new javascript, but I am comfortable in other languages. I'm trying to
I'm using Nodejs and Socket.io. When the client connects, new JavaScript objects are created.
New to javascript and such, trying to create a loop for fading logos using
New to javascript, but I'm sure this is easy. Unfortunately, most of the google

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.