Gets the form's parameters by the given xpath. Valid only inside the loadpage and submitform.
var = getform(xpath[, options]);
Parameters:
xpath | The string with the xpath expression, defining the node's address. | ||||
options | Parameters dictionary. May contain the following elements:
|
Returned value: the dictionary of form parameters. This dictionary can be used for other functions, such as submitform, formsetparam and others.
If xpath defines several forms, it always returns the first.
var['form'] contains a dictionary with all the attributes of the form element, they are always consist of var['form']['action'] and var['form']['method']. var['params'] contains a dictionary of name => value pairs of the form elements, such as input, select, textarea. var['types'] contains a dictionary of name => type pairs of form elements.
Example 1. We will get form's parameters and output the default values, as well as we set some parameters and submit the form.