Solved

Triggering 'Submit' on a Web Page

Posted on 2000-05-11
6
221 Views
Last Modified: 2010-05-02
I am interested in knowing how to fill a text box on a target web page and invoking that page's "submit" button using VB 5.0.  I believe that I have been able to Post the text to the page, but I haven't been able to trigger the 'Submit' button.  It might be helpful to note that the 'Submit' button is the default button on the page.  
0
Comment
Question by:aarik
6 Comments
 
LVL 14

Accepted Solution

by:
mcrider earned 400 total points
ID: 2803074
Add a WebBrowser control to your program and then do this:

   WebBrowser1.Navigate "http://www.yourdomain.com/cgi-bin/your.cgi?Arg1=aaa&Arg2=bbb"

Everything after the "?" is sent to the server as if a GET was performed.  Multiple arguments are separated by "&".

To add the WebBrowser control to your project, right-click on the toolbar and select "Components..." then select "Microsoft Internet Controls" from the list...

By the way, if you don't want the user to see the resulting web page that is returned, set the Visible property of the WebBrowser control to FALSE.


Cheers!®©


0
 
LVL 14

Expert Comment

by:mcrider
ID: 2803083
Also... your "submit" button is going to pass an argument in the URL, so for example:

   WebBrowser1.Navigate "http://www.yourdomain.com/cgi-bin/your.cgi?Arg1=aaa&Arg2=bbb&Submit=1"


Get the idea??


Cheers!®©



0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2803093
if hes already got focus on the page and set the text (as he said) then cant he just use sendkeys??

SendKeys "{TAB i}"  'where i is the number of times you need to tab
SendKeys Chr(32)
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 1

Expert Comment

by:jannea
ID: 2803459
I guess you can use:

Private Declare Function ShellExecute Lib "shell32.dll" Alias _
  "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
  ByVal lpFile As String, ByVal lpParameters As String, _
  ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long


      ShellExecute Me.hwnd, vbNullString, _
      ("http://www.yourdomain.com/cgi-bin/your.cgi?Arg1=aaa&Arg2=bbb&Submit=1", vbNullString, "C:\", 1
0
 

Author Comment

by:aarik
ID: 2804663
Thank you for your prompt response!
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2807710
Thanks for the points! Glad I could help!


Cheers!®©
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now