|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
JavaScript - Get value of SelectedIndex
How do I get the value of a SelectedIndex?
See below code <script> function toggleTextBox(){ var x = document.myform.hotOrderList.options; if(x.[this.selectedIndex].value == 'Yes'){ document.myform.txtHotOrderName.style.display = ''; } else{ document.myform.txtHotOrderName.style.display = 'none'; } } </script> Regards, Edmond |
|
#2
|
||||
|
||||
|
This code is copied straight from one of my projects, but should show you what you need to do:
Code:
j = document.Premium.Title.length;
for (i=0; i<j; i++) {
if (document.Premium.Title[i].selected) var strTitle = document.Premium.Title[i].value;
}
__________________
selwonk |
|
#3
|
|||
|
|||
|
it's selectName.selectedValue i think
|
|
#4
|
||||
|
||||
|
Quote:
That's just not true. You can use the "selectedIndex" property. Code:
var s = document.getElementById("Title");
alert(s.options[s.selectedIndex].value);
__________________
Support requests via PM will be ignored! |
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > JavaScript - Get value of SelectedIndex |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|