Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Read Text In Dropdown Box?
#1
Is there a way to read the text in a textbox on a webpage and select a certain option?

I was selecting the field and typing to jump to the option I want, but I would prefer to be able to verify the option selected is the one that I need.

Thanks,

Paul.
#2
Try accessible object functions or html element functions. The dialogs are in the floating toolbar.
#3
This is the control I am looking to set the value of, however I cant seem to figure out how to get the value to a certain value.

Code:
Copy      Help
Acc combo3=acc("" "COMBOBOX" win("Tipster Proofing - Mozilla Firefox" "MozillaUIWindowClass") "MozillaContentWindowClass" "Course")

The value I want to set it to is "Winsor".

I tried using CB_SelectString, but I cant find an example of it in the guidance.
#4
I tested with the first combo in http://www.racing-index.com/tipsters/ti ... rmance.php

In the Accessible Object Dialog, make to show all objects, and to find hidden objects. Find the combo. In the object tree it has a child LIST object and the list has many LISTITEM objects. Select one. Click OK. Then use DoDefaultAction to select it.
Macro Macro1235
Code:
Copy      Help
Acc a=acc("1st On Racing" "LISTITEM" win("Tipster Proofed Results - Mozilla Firefox" "MozillaUIWindowClass") "MozillaUIWindowClass" "" 0x1011)
a.DoDefaultAction

The above macro is slow, because there are many hidden objects, but can be made faster. Find the combo or an object near it, and navigate to the first listitem. Then enumerate all items, compare name, and DoDefaultAction when it matches name that you need.
Macro Macro1235
Code:
Copy      Help
Acc a=acc("Tipster:" "TEXT" win("Tipster Proofed Results - Mozilla Firefox" "MozillaUIWindowClass") "MozillaUIWindowClass" "" 0x1881 0x40 0x20000040 "next2 first2")
rep
,str s=a.Name
,;out s
,if(a.Name="1st On Racing")
,,a.DoDefaultAction
,,break
,a.Navigate("next"); err break

This is easier. At first find the combo. Search skipping hidden objects. Then find the listitem, but search only in the combo instead of whole window. Search including hidden objects.
Macro Macro1235
Code:
Copy      Help
Acc a=acc("Tipster:" "TEXT" win("Tipster Proofed Results - Mozilla Firefox" "MozillaUIWindowClass") "MozillaUIWindowClass" "" 0x1881 0x40 0x20000040 "next2")
a=acc("1st On Racing" "LISTITEM" a "" "" 16)
a.DoDefaultAction


Forum Jump:


Users browsing this thread: 1 Guest(s)