Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Triggering 'Submit' on a Web Page

Posted on 2000-05-11
6
Medium Priority
?
231 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 14

Accepted Solution

by:
mcrider earned 1600 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

722 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