How do I select a row in a table based on what ddl option is selected MVC?

Posted by user54197 on Stack Overflow See other posts from Stack Overflow or by user54197
Published on 2010-03-08T19:24:14Z Indexed on 2010/03/08 20:06 UTC
Read the original article Hit count: 355

Filed under:
|
|
|
|

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>

© Stack Overflow or respective owner

Related posts about c#

Related posts about JavaScript