Solved

Triggering 'Submit' on a Web Page

Posted on 2000-05-11
6
222 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

932 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

10 Experts available now in Live!

Get 1:1 Help Now