sethiddenwebformitem
PAGE
,
FIELD
,
VALUE

The sethiddenwebformitem statement adds a hidden field to a form on a web page.


Parameters

This statement has three parameters:

page – field or variable containing an HTML page. The page must contain a </form> tag.

field – name of the hidden web form field.

value – value of the hidden web form field.


Description

This statement adds a hidden field to a form on a web page. In addition to normal visible data values (text editing cells, checkboxes, radio buttons, etc.) web browsers also support hidden values within a web form, and this statement lets you add a hidden value after the form has been rendered (hidden values can also be included in the rendering process, see Setting Hidden Form Values).

This example adds a hidden field named PreviousCustomer to the form, and sets the value to yes.

cgiHTML = renderwebform("Invoice","")
sethiddenwebformitem cgiHTML,"PreviousCustomer","YES"

When the form is filled out and submitted back to the server, the PreviousCustomer value will be included, and can be accessed with the webformitemvalue( statement, just like any other item in the web form.

You can also use a variable or expression for the hidden field value, like this:

let discountPercentage = 15
...
cgiHTML = renderwebform("Invoice","")
sethiddenwebformitem cgiHTML,"Discount",discountPercentage

Hidden field values are always text, but if a numeric value is supplied (as in the example above) it will automatically be converted to text for you.


See Also


History

VersionStatusNotes
10.2No ChangeCarried over from Panorama 6.0.