images/littlesamie.jpg (853 bytes)

sub ClickFormImage {##$imageName, [$popup, $CheckForMessageBox, $nowait]
Description: Clicks on a  Form Submit Image

How To:

Find the submit name in your html with View Source:

Example:

<form METHOD=POST ACTION="http://www.2kweb.net/cgi-bin/formmail.cgi">
     <input TYPE="text" NAME="persons-name" SIZE="40" MAXLENGTH="40">
     <input TYPE="hidden" NAME="recipient" SIZE="40" MAXLENGTH="40">
     <input TYPE="password" NAME="password" SIZE="10" MAXLENGTH="10">
     <input TYPE="image" alt="Request" src="images\requestbutton.jpg">
</form>

If you want to click on the Request button image.

ClickFormImage("Request");

Cookbook Recipe:

use Win32::OLE;
use Win32::SAM; #use Win32::Slingshot;
$| = 1; my $URL = "http://samie.sf.net/imageform.html"; my $seconds; $Win32::OLE::Warn = 3; StartIE(); $seconds = Navigate($URL); print "imageform.html page took $seconds seconds to load\n"; SetEditBox("name","samie"); SetEditBox("age","about 2 years old now"); $seconds = ClickFormImage("samie"); print "Answer Page took $seconds seconds to load\n";


Further Notes:

The second parameter $popup is optional.
It tells samie that the FormButton is going to raise a popup window.


The third parameter $CheckForMessageBox is optional.
It tells samie that a message box will appear when this button is clicked.
With this paramter set to 1 samie will resume the process to react to the message box.
This process must first be started with a call to VerifyMessageBox.

The fourth parameter $nowwait is optional. It is used when you don't want samie to call WaitForDocumentComplete
or WaitForDocumentCompleteForPopup after you click the button.


images/littlesamie.jpg (853 bytes)