Jump to content

Reading the value selected from a dropdown..


tommytx
 Share

Recommended Posts

Option value 125 has selected /san-mateo/ how do I pull that city out.. what I have prints the 125 but I cannot figure out how to convert the 125 to /san-mateo/

I have tried lots of stuff to read the selected item.. For example below the selected item is /san-mateo/ and i want to print it to the console.. The one not commented out will print the index number of 125... So what am I missing to convert the 125 over to pull out the /san-mateo/ instead.. The 3 in comment is what I have been trying to no avail.  Thanks in advance for any help.
 

$oDiv = _IEGetObjById($oIE, "id_parent")

ConsoleWrite($oDiv.options.value)  "Prints the number 125.)

; ConsoleWrite($oDiv.options.selectedIndex.value & @CR) "Fails"
; ConsoleWrite($oDiv.selectedIndex.value & @CR) "Fails"
; ConsoleWrite($oDiv.options[$oDiv.selectedIndex].value; "Fails"

sample drop down box..
**********************

<label for="id_parent">Parent:</label>

<select name="parent" id="id_parent">

<option value="">---------</option>
<option value="1">/burlingame/</option>
<option value="2">/pacifica/</option>
<option value="125" selected="selected">/san-mateo/</option>
<option value="124">/daly-city/</option>
</select>
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...