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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:57:17+00:00 2026-05-29T07:57:17+00:00

Hi all I am a newbie in web programming so please help me out

  • 0

Hi all I am a newbie in web programming so please help me out in this problem. I am trying to make 2 drop down lists linked together which I got from another forum and then I am trying to link the go button to another webpage according to option selected. For going to another page i got the function but when I am trying to link it is not working

Here is the code.There are two functions 1. for linking drop down lists 2. for going to another page. but it is not working as i have written the onClick function go to a new page.

<html>
<head>
<script type="text/javascript">
function setOptions(chosen) {
var selbox = document.myform.opttwo;

selbox.options.length = 0;
if (chosen == " ") {
selbox.options[selbox.options.length] = new Option('Please select one of the options        above first',' ');

}
if (chosen == "1") {
selbox.options[selbox.options.length] = new
Option('http://www.google.com','oneone');
selbox.options[selbox.options.length] = new
Option('first choice - option two','onetwo');
}
if (chosen == "2") {
selbox.options[selbox.options.length] = new
Option('second choice - option one','twoone');
selbox.options[selbox.options.length] = new
Option('second choice - option two','twotwo');
}
if (chosen == "3") {
selbox.options[selbox.options.length] = new
Option('third choice - option one','threeone');
selbox.options[selbox.options.length] = new
Option('third choice - option two','threetwo');
}
}
</script>
<SCRIPT LANGUAGE="JavaScript">
<!--
function JumpToIt(frm) {
var newPage = frm.url.options[frm.url.selectedIndex].value
if (newPage != "None") {
    location.href=newPage
}
}
//-->
</SCRIPT>
</head>
<form name="myform"><div align="center">
<select name="optone" size="1"
onchange="setOptions(document.myform.optone.options
[document.myform.optone.selectedIndex].value);">
<option value=" " selected="selected"> </option>
<option value="1">First Choice</option>
<option value="2">Second Choice</option>
<option value="3">Third Choice</option>
</select><br> <br>
<select name="opttwo" size="1">  
<option value=" " selected="selected">Please select one of the options above     first</option>
</select>
<INPUT TYPE=BUTTON VALUE="Go!" onClick="JumpToIt(this.myform)">
</div></form>
</html>

so someone please tell me what should i write in the onclick function so that it will go to the linked page.

  • 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-05-29T07:57:18+00:00Added an answer on May 29, 2026 at 7:57 am
    <html>
    
    <head>
    
    <script type="text/javascript"> 
        function setOptions(chosen) 
        { 
            var selbox = document.myform.opttwo;  
            selbox.options.length = 0; 
    
            if (chosen == " ") 
            { 
                selbox.options[selbox.options.length] = new Option('Please select one of the options        above first',' ');  } 
    
                if (chosen == "1") { selbox.options[selbox.options.length] = new Option('http://www.google.com','oneone'); selbox.options[selbox.options.length] = new Option('first choice - option two','onetwo'); } 
                if (chosen == "2") { selbox.options[selbox.options.length] = new Option('second choice - option one','twoone'); selbox.options[selbox.options.length] = new Option('second choice - option two','twotwo'); } 
                if (chosen == "3") { selbox.options[selbox.options.length] = new Option('third choice - option one','threeone'); selbox.options[selbox.options.length] = new Option('third choice - option two','threetwo'); 
            } 
        } 
    
        function JumpToIt(frm) 
        { 
            var newPage = frm.opttwo.options[frm.opttwo.options.selectedIndex].value;
    
    
            if (newPage != "None") { location.href=newPage; } 
        } 
    
    </script>
    
    </head>
    <form name="myform">
        <div align="center">
            <select name="optone" size="1" onchange="setOptions(document.myform.optone.options [document.myform.optone.selectedIndex].value);">
                <option value=" " selected="selected"></option>
                <option value="1">First Choice</option>
                <option value="2">Second Choice</option>
                <option value="3">Third Choice</option>
            </select>
            <br>
            <br>
            <select name="opttwo" size="1">
                <option value=" " selected="selected">Please select one of the options above first</option>
            </select>
            <input type="BUTTON" value="Go!" onclick="JumpToIt(document.myform)">
        </div>
    </form>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Dear All, please help me since I'm newbie in SQL Server. I have a
.NET/MVC3 newbie, so please bear with me! I've searched for this answer all over
dear all.i newbie at web programming and until now i still have learn about
I am a newbie to Java Web Application development. So far all I have
I'm a newbie to all this ASP.NET MVC stuff, and I was making some
Hey all. Newbie question time. I'm trying to setup JMXQuery to connect to my
Newbie question since I'm not up to speed using maven at all. I'm trying
An XSLT-newbie problem: I need to substitute a text value in XML-file. All other
I am trying to help some people getting started programming on rails identify which
I am a newbie in web-development and am trying to use Jmeter for doing

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.