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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem Clicking Login Button on Web Page 1

Status
Not open for further replies.

Error7

Programmer
Joined
Jul 5, 2002
Messages
656
Location
GB
I'm out of my depth with HTML. On this webpage I've been able to add the Username & Password but I can't figure out how to click on the Login Button.

This is the HTML code for the button:
<div class="loginbtn" onclick="DoLogin()" onmouseover="this.className = 'loginbtnon'" onmouseout="this.className = 'loginbtn'"><label name="lalogin" class="mousepointer">Login</label></div>

So far I've tried:
WB1.Document.getElementById("DoLogin()").Click
WB1.Document.frames("Frame1").Document.getElementById("loginbtn").Click
WB1.Document.getElementsByName("loginbtn").Click
WB1.Document.All("loginbtn").Click

and Strongm's code:
Dim oCol As IHTMLElementCollection
Set oCol = Form1.WB1.Document.All.tags("loginbtn")

For Each oelement In oCol
If InStr(oelement.className, "loginbtn") > 0 Then
oelement.Click
End If
Next oelement
End Sub

None of the above work. Any help with this would be much appreciated.


[gray]Experience is something you don't get until just after you need it.[/gray]
 
WB1.Document.parentWindow.execScript "DoLogin()
 
Thanks strongm, you're a genius.

[gray]Experience is something you don't get until just after you need it.[/gray]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top