Alertra Script Language 1.9

parseform

Parse the given content for a specific "form" tag. Parsed form attributes are placed in local variables. Parsed form input fields are placed in variables that can be set via the form command.

form names

A single HTML page can contain multiple forms, so typically each form has its "name" property set to some unique name. If that is the case, then you can control which form "parseform" parses by supplying that name:

	parseform "login"

When the form is parsed, the form attributes are put into local variables that can be accessed from the script. For instance, parsing this form:

	<form name="login" action="login.asp">

Would result in the following variables:

NameValue
FORM_login_namelogin
FORM_login_actionlogin.asp

In some cases, usually with only one form in the HTML, the form may not have it's name property set. In this case, parseform will give it the name "alertraMAIN". Note: If your HTML has more than one form without it's name property set, you cannot use parseform.

The input fields of the form are also parsed and stored in variables. A form with two input fields, 'username' and 'password' plus a hidden field called '__VIEWSTATE', would cause the following variables to be set:

NameValue
input_login_username_value[some value]
input_login_password_value[some password]
input_login___viewstate_typehidden
input_login___viewstate_value[some value]

The parseform command will automatically copy any form input values that have a default value to the form variable collection (see: form). You only need to set those values if you want to override the default. For instance, in the example above say 'username' and 'password' don't have default values, but '__VIEWSTATE' does. In that case, after calling parseform the form variable '__VIEWSTATE' would already be set from the value parsed from the HTML.

usage: parseform [formname]

parameters:

req name type description
Y formname expression Name of the form to parse.

examples

parseform "login"

Parses the "login" form and puts the values in FORM_login_X variables.


Alertra Script Language: Language Reference