SetFieldWithLabel
Description:
Set a Field on the current Document that has a Label matching the specified Text.
Format:
SetFieldWithLabel (integer Session ID (optional), string Text, integer Occurrence (optional))
|
Parameters: |
Integer |
Session ID (optional) |
Browser Occurrence Number.
First Browser occurrence is 1
Default value is 1 |
|
String |
Label |
Label displayed before the Field.
Wildcards ('*') are allowed |
|
String |
Value |
Value to place in Field |
|
Integer |
Occurrence (optional) |
Label Occurrence Number.
First Label occurrence is 1
Default value is 1 |
|
Return Value: |
Boolean |
Success Ind |
Success Indicator.
TRUE – Field was set
FALSE – Field was not set |
Usage:
Use this function to set a Value in a Field (textbox) that has a perceived label specified in Label on the current Document. Label is what is displayed on the Document, not the internal HTML Name. A Perceived Label is text that precedes the target field. The 'Label' is not really associated with the field. AutoWeb finds the matching Label Text and then set the next Field it finds with the Value. This method is usually reliable, but not perfect. For a more reliable method use the SetFieldWithName function. Wildcards can be specified in the Label Text string to match on partial displayed Label Text on the Document. The wildcard character is the asterisk ('*') and can be used on the beginning and/or end of the Label Text string. Use the optional Label Occurrence Number when more than one Label on the Document matches the Label Text string. Matches are not Case Sensitive.
Example 1:
Set a Field that has the Label of 'Password'.
SetFieldWithLabel ('Password', 'Cactus')
Example 2:
Set a Field for the second Label that displays the word 'Bird'.
ClickLinkWithText ('Bird', 'Robin', 2)
Example 3:
Set the third Field that has the Label 'Product' at the beginning of the Label text in the second occurrence of the Browser.
ClickLinkWithText (2, 'Product*', 3)