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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:53:44+00:00 2026-05-13T21:53:44+00:00

I have a table with a few rows of data. I would like to

  • 0

I have a table with a few rows of data. I would like to display a row based on what option is selected on the ddl. how do I do that?

<script type="text/javascript" language="javascript">
     function optionSelected() {
          alert('HELP!!');
     }
</script>
...
<select id="optionSelect" onchange="optionSelected()">
    <option id="1">1</option>
    <option id="2">2</option>
    <option id="3">3</option>
</select>
<br />
<table id="optionList">
    <tr><td id="1">Option 1 Selected</td></tr>
    <tr><td id="2">Option 2 Selected</td></tr>
    <tr><td id="3">Option 3 Selected</td></tr>
</table>
  • 1 1 Answer
  • 2 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-13T21:53:44+00:00Added an answer on May 13, 2026 at 9:53 pm

    First I’d apply the handler using javascript rather than inline. Second, you don’t say how you know which row goes with which element in the dropdown, so I’ll assume it’s the numeric value of the option. Note that the rows are counted from zero, whereas your options are numbered from one.

    $('#optionSelect').change( function() {
         var val = int.Parse($(this).val(),10) - 1; // calculate row number
    
         $('#optionList').find('tr').hide() // hide all rows
                         .eq(val) // get the selected row
                         .show(); // and show it
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an insert statement that pulls some data into a few table variables
I have a table that looks something like this. <table> <thead> <tr> <th>Foo</th> <th>Bar</th>
We have a product that runs Sql Server Express 2005 and uses mainly ASP.NET.
Consider searching a table that contains Apartment Rental Information: A client using the interface
I need to obfuscate or encrypt some plain text data in my php 5.2
I have 3 text files each of which contains a list of 20 items.
I'm about to have to rewrite some rather old code using SQL Server's BULK
I was wondering if anyone can point me in the direction of examples or
I've got a database in production for nearly 3 years, on Sql 2008 (was

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.