Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Entering information on a Web Page

Status
Not open for further replies.

DavePilot

Programmer
Feb 12, 2002
12
US
I'm writing a VBScript to navigate to a secure site and log in. The log in process has a radio button to select which part of the company you are with and 2 fields one for employee id and your password.

I can launch the IE object and navigate to the logon page and enter my employee id and password but I cannot figure out how to select a radio button. Any Ideas?

So far:

' Create an instance of the Internet Explorer object
Set objIE = WScript.CreateObject ("InternetExplorer.Application")

' Make the window visible
objIE.Visible = True

' Navigate to the pilot web site logon
objIE.Navigate "
do while objIE.busy
' wait for the page to load
loop

' Logon to the site. Using form information
objIE.document.forms(0).Employeeid.value="xxxxx"
objIE.document.forms(0).password.value="xxxxx"
objIE.document.forms(0).submit

I've tried:
'objIE.document.forms(0).Airline.value="AS"
'objIE.document.forms(0).Airline.value="checked"

for the radio button but no luck. The web source:
<input type=&quot;radio&quot; name=&quot;Airline&quot; value=&quot;AS&quot; onclick=&quot;setvalue('arctic_on');&quot;><font face=&quot;arial&quot; size=&quot;2&quot; color=&quot;black&quot;>Alaska
<input type=&quot;radio&quot; name=&quot;Airline&quot; value=&quot;QX&quot; onclick=&quot;setvalue2('arctic_on');&quot;><font face=&quot;arial&quot; size=&quot;2&quot; color=&quot;black&quot;>Horizon


Any ideas?

Thanks,
Dave
 
Thanks for the help. I've found to ways for this to work successfuly.

Either:
objIE.document.forms(0).Airline(0).click
objIE.document.forms(0).Airline(0).checked=true

Thanks,
Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top