InputBox

Description:
Display a Form to collect information from a User

Format:
InputBox (string Title, string Message, string, Labels, string Fields, string Buttons)

Parameters:

Stringr

Title

Title of the InputBox form

String

Message

Message displayed in the InputBox form

String

Labels

Comma delimited list of Labels and Attributes for Fields.

Each Label must have a corresponding Field.

Each Label may end in special attribute characters which are stripped off of the Label and used to control the associated Field

The format of the optional attribute is #nnaa…a where:
# – is the beginning of the attribute
nn – is the length of the field, default is 10
aa…a – is a list of single character attributes
  R – field is Required
  P – field is a Password

attribute examples :
#1 is a single character optional field
#40R is a 40 character required field
#PR is a 10 character required, password field

String

Fields

Comma delimited list of Variable Names. The Variable Names can represent string, integer, decimal, or boolean variables.

Each Field must have a corresponding Label.

A Field on the InputBox form will be displayed for each variable. String, integer, and decimal variables will be displayed as input fields up to approximately 40 characters long. Boolean variables will be displayed as CheckBoxes.

Current values of variables will be displayed on the form when it is displayed.

Data entered into fields is checked for the correct type before allowing the Form to be closed.

String

Buttons

Comma delimited list of Button Names.

The Cancel button is always added to the list Do not include a Cancel button.

Return Value:

String

Button

Name of Button that was clicked.
Always returned as UPPERCASE

Usage:
Use this function to create and display a Form to collect information from the User. The form can collect information for one or more variables in the script.

A sound is heard when an InputBox opens.
When an Input Box is opened the Autoweb Control Panel is hidden until the InputBox is closed.
Data entered into a field must be valid for the field type. (i.e. an Integer field must have only numbers in it)
Label lengths, excluding attributes, are limited to 40 characters.
Field length attributes determine the size of the field. Approximately 40 characters is the maximum displayed, but the field may be longer and will scroll horizontally. Field length attributes are ignored for Boolean variables
Field length attributes, if present, must be first in the attribute, single character attributes may be in any order.
Labels for Required Fields are displayed in Magenta with an asterisk added to the end of the label.
Required fields must have values before completing the form., unless the Cancel button is pressed.
When a Cancel button is pressed all values entered into the form are ignored and the variable values remain unchanged.
Password fields display a large dot for each character instead of the actual character typed.

Example 1:
Basic InputBox to retrieve the value for one variable. The value can be 40 characters long and is required. If the User presses 'Ok' a field is set and a button is clicked.

String strSearch

If InputBox('Search', 'Enter your search words', 'Words:#40R', 'strSearch', 'Ok') = 'OK'
 SetFieldWithLabel ('Search', strSearch)
 ClickButtonWithText ('Submit')
EndIf

Example 2:
Complex InputBox. Open an InputBox for logging on to an application, Require User ID and Password fields. Allow up to 20 characters in the User ID. Hide the value in the Password field. Display Submit and Cancel buttons.

// Declare variables
string strTitle
string strMessage
string strLabels
string strFields
string strButtons
string strResult

string strUser
string strPass
boolean boolSave

// Set Values
strTitle = 'Logon to Application'
strMessage = 'Enter your User ID and Password to logon.'
strLabels = 'UserID:#20R, Password:#PR, Remember ?:'
strFields = 'strUser, strPass, boolSave'
strButtons = 'Submit'

strUser = 'JohnSmith' // Default User ID

strResult = InputBox (strTitle, strMessage, strLabels, strFields, strButtons)
If strResult = 'SUBMIT'
 // Do something
 . . .
EndIf

Hosted by www.Geocities.ws

1