grabwebformitems
OPTIONS
The grabwebformitems statement grabs multiple web form items and stuffs the values into fields and/or variables.
Parameters
This statement has one parameter:
options – various options, each option in OPTION=VALUE
format. See the body of this page below for details on the available options.
Description
This statement grabs multiple web form items and stuffs the values into fields and/or variables. The grabwebformitems statement has one parameter, a list of options in option=value format. There are three possible options: items, assign and variables.
grabwebformitems “items=type/list assign=type variables=type”
The items option specifies what web form items to “grab” and assign to fields and/or variables. If this option is not specified then all visible items will be processed. You can specify a list of items (comma separated), or you can specify “visible”, “hidden” or “all”. Here are some examples:
grabwebformitems {items="Name,City,State,Country,Email,Name"}
grabwebformitems {items=Visible}
grabwebformitems {items=all}
The assign option specifies whether to grab the values into fields, into variables, or both. There are four possible choices: fields, variables, noconflictvariables, or any.
- If the fields option is used the web form items will be assigned into corresponding database fields. If there is no corresponding database field an error will occur (which can be trapped with if error).
- If the variables option is used the statement will automatically create variables for each of the specified web form items and then assign the item values to the variables. If a web form item has the same name as a database field, a variable will still be created, which may make it impossible to access the database field.
- If the noconflictvariables option is used the statement will automatically create variables for each of the specified web form items and then assign the item values to the variables. If a web form item has the same name as a database field a variable an error will occur (which can be trapped with if error). This is the default option if no assign option is specified.
- If the any option is used any web form items that correspond to database fields will be assigned to the those fields. Any remaining web form items will be assigned to variables, which will automatically be created if necessary.
Here is an example that adds a new record to the current database, then fills in the new record with the data from the web form.
addrecord
grabwebformitems “assign=FIELDS”
The variables option specifies what type of variable should be created: local (the default), fileglobal, global (not usually recommended), or permanent. Here is an example that takes all of the items in the submitted web form and copies them into variables with the same names as the items in the web form.
grabformwebitems “items=visible assign=variables variables=fileglobal“
See Also
- deletewebtemplate -- deletes the web template (a dictionary) associated with a form (if any).
- getwebtemplate -- retrieves the web template (a dictionary) associated with a form (if any).
- getwebtemplate( -- retrieves the web template (a dictionary) associated with a form (if any).
- getwebtemplatetext -- retrieves the text of the web template (a dictionary) associated with a form (if any).
- getwebtemplatetext( -- retrieves the text of the web template (a dictionary) associated with a form (if any).
- listwebtemplates -- retrieves a list of web templates in the specified database, if any.
- listwebtemplates( -- retrieves a list of web templates in the specified database, if any.
- makeformwebtemplate -- converts a Panorama form into the equivalent HTML/CSS.
- renderwebform -- renders a Panorama web form into HTML, merging data into the template as necessary.
- renderwebform( -- renders a Panorama web form into HTML, merging data into the template as necessary.
- retrywebform -- retries a web form that has missing or invalid data.
- savewebtemplate -- saves a web template (a dictionary) associated with a form.
- sethiddenwebformitem -- adds a hidden field to a form on a web page.
- webdatabasetoform -- fills in an HTML form with database field values.
- webfontsubstitutes -- generates an array of standard font substitutions for web browsers.
- webformallitems( -- returns a list of POST parameters passed from a form to the web server as a carriage return separated list.
- webformerrors( -- returns a list of errors that have been collected with the WebFormItemCheck statement.
- webformhiddenitems( -- returns a list of the hidden items in the web form submitted to this web procedure.
- webformitembang -- sets the text generated by the webformitembang( function.
- webformitemnames -- returns a list of POST parameters passed from a form to the web server as a carriage return separated list.
- webformitemnames( -- returns a list of POST parameters passed from a form to the web server as a carriage return separated list.
- webformitems( -- returns a list of POST parameters passed from a form to the web server, including both visible and invisible items (but excluding the special items Panorama generates for its own internal use).
- webformmerge -- fills in an HTML form with database values (fields and variables).
- webformrecordid -- adds a RECORD_ID hidden field to the HTML of a web form.
- webformselection -- selects data based on input from a web form. The web form must have fields that match the database fields.
- webformtodatabase -- updates the current database with information from the web form that was just submitted.
- webformvisibleitems( -- returns a list of the visible items in the web form submitted to this web procedure.
- webmerge -- merges an external HTML template file with fields and variables from the current record.
- webthisrecordkey -- makes a key for use with the WebURLSelect statement to specify the current record.
History
10.2 | No Change | Carried over from Panorama 6.0. |