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!

Submit Form...Indirectly

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have some client-side vbscript that I'm executing through an IE menu-extension. Basically what this script does is fill-in a user's Username/Password combo for Bulletin Boards, Online E-mail accounts, and the like. All a user has to do to fill-in their Username/Password combo is right-click on the textbox, and choose "-= Login =-" from the context menu and their Username/Password is automatically filled in. I have code to submit the form, but it has no effect. Anyone have an idea on how I can submit the form?

Here's the code I'm using:
Code:
<SCRIPT LANGUAGE = &quot;VBScript&quot;>
Dim oWindow,oDocument

Set oWindow = window.external.menuArguments
Set oSource = oWindow.event.srcElement 
Set oDocument = oWindow.document

If oSource.tagName = &quot;INPUT&quot; Then
 Select Case oWindow.location
	<!--'VBFORUMS-->
  Case &quot;[URL unfurl="true"]http://www.vbforums.com/&quot;[/URL]
    oDocument.Forms(2).elements(&quot;username&quot;).Value = &quot;YourUsername&quot;
    oDocument.Forms(2).elements(&quot;password&quot;).Value = &quot;YourPassword&quot;
    oDocument.Forms(2).Submit
	<!--'HOTMAIL-->
  Case &quot;[URL unfurl="true"]http://lc1.law5.hotmail.passport.com/cgi-bin/login&quot;[/URL]
    oDocument.Forms(0).elements(&quot;login&quot;).Value = &quot;YourUsername&quot;
    oDocument.Forms(0).elements(&quot;passwd&quot;).Value = &quot;YourPassword&quot;
    oDocument.Forms(0).Submit
 End Select
End If
</SCRIPT>
 
OOps I probably should have mentioned that this script is being executed from a local file (login.htm) on my hard drive. Here's how it works. When I surf to a web-page that requires a login, then I right-click the Username textbox and choose &quot;-= Login =-&quot; from the context menu. This menu item is pointed to my login.htm file and the script within is executed. If you want I can e-mail you a copy for you to try out. Everything seems to work fine...except I can't figure out how to submit the Form. Hopefully there's a way. :)
 
CYM...
Installation instructions are in the HTML source code of the Login.htm file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top