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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:10:07+00:00 2026-06-18T15:10:07+00:00

I have a JavaScript that changes the output on the same page by using:

  • 0

I have a JavaScript that changes the output on the same page by using:

<"a href="#" onclick="change('Bob','0','0','2','2','1','0','0')">Bob</a>
<"a href="#" onclick="change('Sam','0','0','2','2','1','0','0')">Sam</a>
<"a href="#" onclick="change('Ted','0','0','2','2','1','0','0')">Ted</a>    

I would like to change the links to a dropdown (select – option) form field.

Any help putting me in the right direction will be appreciated.

  • 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-18T15:10:08+00:00Added an answer on June 18, 2026 at 3:10 pm
    <select size="1" onchange="change(this.value, '0','0','2','2','1','0','0')">
        <option>Bob</option>
        <option>Sam</option>
        <option>Ted</option>
    <select>
    

    Using this.value gives you the currently selected option of the select box (Bob, Sam or Ted).


    EDIT

    If you want to pass different parameters to your function, you can do it like this:

    Javascript:

    function selectValueChanged(value){
        switch(value){
            case "Bob":
                change('Bob','-1','0','2','4','6','0','0');
                break;
            case "Sam":
                change('Sam','0','-2','3','5','1','0','2');
                break;
            case "Ted":
                change('Ted','2','1','4','2','3','2','0');
                break;
        }
    }
    

    HTML:

    <select size="1" onchange="selectValueChanged(this.value)">
        <option>Bob</option>
        <option>Sam</option>
        <option>Ted</option>
    <select>
    

    So you pass your selected value to selectValueChanged, and this function calls the change function with the appropriate paremeters.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Change all links that have an image in it to: javascript(alert(thehref)); eg. <a href=/galleries/anna-leah-111827/image01.html><img
I have a javascript function that changes the innerHtml of a <div> tag to
I have a function in javascript that changes a span class when I click
I have some javascript that I am using for some audio on my website:
In a PHP page I have a drop-down list that triggers the jQuery change
I have a page that makes the same JSONP request multiple times in a
I have Javascript that opens another window and registers a click handler for all
I have JavaScript that is doing activity periodically. When the user is not looking
I have a javascript that returns a value whenever I choose an option from
I have some javascript that goes out and fetches a javascript class on another

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.