Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying the text select in a combobox???

Status
Not open for further replies.

shawn876

Programmer
Feb 19, 2004
17
US
HI everyone:
I have a combobox which displays with the values
A, B, C.
What I need is when I select the text in the combobox I need to use that text to display in a table.
For example:
B is the value but in the combobox it shows up as Hi
I need use that text value.
Please help Thanks
 
use innerhtml:
Code:
<script language=javascript>
function selectText(a) {
   alert("value: " + a.options(a.selectedIndex).value + "\nText: " + a.options(a.selectedIndex).innerHTML)
}
</script>
<form name=blahForm>
<select onchange='selectText(this)'>
<option value=1>One
<option value=2>Two
<option value=3>Three
</select>
</form>

-kaht

banghead.gif
 
Hey Thank you very much I did get it to work. But How do I get it so that when I print the page that text value shows up on the page. Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top