Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get value shown on screen not actual value
#1
I am trying to get the value on a HTML combo list as seen on the screen. The HTML for the list is:

<option value="123">option a</option>
<option value="234">option b</option>

if I create a macro to set the index to 2 "option b" shows up on the screen but when I use the following code "234" is returned:

MSHTML.IHTMLElement el=htm("SELECT" "FP_cboList" "" "Internet Explorer" 0 0 0x121)
MSHTML.IHTMLSelectElement elsel=+el;
elsel.selectedIndex=2
str wh=elsel.value
out wh

Is there a way to get "option b" to be returned?

Thanks,

Carl
#2
Get OPTION element (IHTMLOptionElement or IHTMLElement) and get its text.

...
MSHTML.IHTMLSelectElement elsel=+el
elsel.selectedIndex=1
MSHTML.IHTMLElement elo=elsel.item(1)
str wh=elo.innerText
out wh


Forum Jump:


Users browsing this thread: 1 Guest(s)