Solved

Triggering 'Submit' on a Web Page

Posted on 2000-05-11
6
230 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 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

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…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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…
Suggested Courses
Course of the Month7 days, 9 hours left to enroll

632 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