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

I am looking at tryin to click the onclick button

Status
Not open for further replies.

tt300zrcr

IS-IT--Management
Sep 21, 2010
6
US
HTML is listed below.
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="GetInfo()" onResize="fit_center()">
<table id=loginback border="0" cellpadding="0" cellspacing="0" background="images/login_back.gif" width=480 height=222 style='POSITION:absolute'>
<tr><td align=left valign=top>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td id=login1 width="105" height="59"></td>
<td width="170"></td>
<td width="20"></td>
<td width="150"></td>
</tr>
<tr>
<td height="22"></td>
<td align="left" valign="middle"><input name="login_id" type="text" class="noborder" size="26"></td>
<td colspan="2" align="right">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input name="saveCookie" type="checkbox" checked class="noborder"></td>
<td width="2"></td>
<td>Save ID</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="13" colspan="4"></td>
</tr>
<tr>
<td height="22"></td>
<td align="left" valign="middle"><input name="login_passwd" type="password" class="noborder" size="26"></td>
<td></td>
<td align="left" class="bold_ha" valign="middle">
<a href="#" onClick="on_Login()">[LOGIN]</a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="#" onClick="on_Exit()">[EXIT]</a>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td id=login2 width="103" height="18"></td>
<td width="22"></td>
<td width="96"></td>
<td width="47"></td>
<td width="9"></td>
<td width="22"></td>
<td width="103"></td>
<td width="47"></td>
</tr>
<tr>
<td height="22"></td>
<td><input type="radio" id="radio_watch" name="select_mode" value="watch" class="noborder" checked></td>
<td></td>
<td align="left"><input name="watchport" type="text" class="noborder" size="4" value="8016"></td>
<td></td>
<td><input type="radio" id="radio_search" name="select_mode" value="search" class="noborder"></td>
<td></td>
<td align="left"><input name="searchport" type="text" class="noborder" size="4" value="10019"></td>
</tr>
<tr id=login3>
<td height="6" colspan="8"></td>
</tr>
<tr id=login4>
<td height="22"></td>
<td></td>
<td></td>
<td align="left"><input name="audioport" type="text" class="noborder" size="4" value="8116"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>


I have writen the userid and password fields fine but i cannot get it to click the button. Any help would be great.
 
This is a VBScript forum, not HTML. Where's the VBS?

-Geates

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."
- Martin Golding

"There are seldom good technological solutions to behavioral problems."
- Ed Crowley, Exchange guru and technology curmudgeon
 
Function Main
Set IE = WScript.CreateObject("InternetExplorer.Application", "IE_")
set WshShell = CreateObject("WScript.Shell")
IE.Visible = True
IE.Navigate " Wait IE
IE.Document.getElementByID("login_id").value = "admin"
IE.Document.getElementByID("login_passwd").value = ""



End Function

Sub Wait(IE)
Do
WScript.Sleep 500
Loop While IE.ReadyState < 4 And IE.Busy
Do
WScript.Sleep 500
Loop While IE.ReadyState < 4 And IE.Busy
End Sub

Sub IE_OnQuit
On Error Resume Next
WScript.StdErr.WriteLine "IE closed before script finished."
WScript.Quit
End Sub
 
shouldn't

Code:
<a href="#" onClick="on_Exit()">[EXIT]</a>

be

Code:
<a href="#" onClick="[red]IE_OnQuit()[/red]">[EXIT]</a>

but I'm still not clear as to what you are asking

-Geates

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."
- Martin Golding

"There are seldom good technological solutions to behavioral problems."
- Ed Crowley, Exchange guru and technology curmudgeon
 
What i am asking is how do i go about clicking the login button from that webpage. Its DVR webpage that i need to login prior to displaying the image in my application.

the vbscript populates the userid, userlogin but i cannot hit the login button automatically i dont know what type of document.type click it is .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top