Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Accessing listboxes via automation
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Titre:
Accessing listboxes via automation
Divers
Thread ID:
00186384
Message ID:
00186384
Vues:
56
I'm having a problem accessing the data in a listbox of an html page. I can't seem to get the value for a list box called state. I know if I'm trying to deal with radio buttons code like the following will allow me to select an option:
oie=create('internetexplorer.application')
oie.navigate('http://superbowl.lycos.com/poll/q1.html')
oie.document.forms(1).q1(0).click()
oie.document.forms(1).submit()
However, when encountering a listbox, I can't seem to get a handle on the data in the box. Here's some code that will take you to a page which contains a listbox with states in it:
oie=create('internetexplorer.application')
oie.navigate('http://www4.ncdc.noaa.gov/cgi-win/wwcgi.dll?WWDI~getstate~USA')
? oie.document.forms(0).state.selectedindex() && will show 0
*If you select something else in the box, you will get an index number
* when you reissue the code -
 ? oie.document.forms(0).state.selectedindex() && will show 0

I've tried several different things, but nothing yields any values.
? oie.document.forms(0).state(1).text && will show ' '
? oie.document.forms(0).state(1).value && will show ' '
? oie.document.forms(0).state(1).title && will show ' '
I saved the html to a local file and opened it in VI to look at the object hierarchy, but still haven't got a clue. Any help is appreciated.
John Harvey
Shelbynet.com

"I'm addicted to placebos. I could quit, but it wouldn't matter." Stephen Wright
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform