webdatabasetoform
webdatabasetoform
DATAPAGE
,
PAGE

The webdatabasetoform statement fills in an HTML form with database field values.

Parameters

This statement has two parameters:

datapage – name of a field or variable to hold the modified output page.

page – HTML text that includes a web form. The `<input>`, `<hidden>`, `<textarea>` and `<select>` tags of this form must be arranged exactly in the format described below.

Description

This statement fills in a HTML form with database field values. The data items on the form must be in an exact special format as described below in the section Special Format for Data Items.

Important Note: The webdatabasetoform statement is not normally used directly. Instead, normal practice is to use the renderwebform statement or renderwebform( function. These operations automatically merge the data for you. The webdatabasetoform statement is included for compatibility with legacy applications, but we recommend using renderwebform for new applications.

Here is an example that shows how to fill in an HTML form with data from the current database record.

    webdatabasetoform cgiHTML,getwebtemplatetext("Invoice")

### Special Format for Data Items

The `<input>`, `<hidden>`, `<textarea>` and `<select>` tags of this form must be arranged exactly in the format described below, or the data won’t be merged properly. If the web form is generated by Panorama (see Converting a Panorama Form into a Web Form), this is taken care of for you, but if you hand code your web form, it must exactly follow the rules described below.

Text input fields must be set up like this:

    <input type="text" name="Field" value="" size=20>

The `name=` parameter must appear just before the `value=` parameter, with one space in between. Both `name=` and `value=` must be in all lower case. You cannot omit the `value=""` parameter. There must be quotes around the field name, and the value must be `""`. The arrangement of the other options doesn’t matter.

Checkboxes and radio buttons must be set up like this:

    <input type="checkbox/radio" name="Field" value="value"> value

The `name=` parameter must appear just before the value= parameter, with one space in between. Both `name=` and `value=` must be in all lower case. There must be quotes around the field name and the value. Do not include a checked option in the tag - the webdatabasetoform statement will do that for you. The arrangement of the other options doesn’t matter.

Multiline input fields must be set up like this:

    <textarea cols=40 rows=6 name="Field"></textarea>

The `name=` parameter must appear at the end of the tag, right before the `>`, and it must be quoted, and `name=` must be in lower case. There must be no blanks between the `>` and `</textarea>`. The arrangement of the other options doesn’t matter.

Pop-up menus and scrolling lists require a slightly non-standard format. The `<select>` tag is the same as normal, but the `<option>` tags must be formatted like this:

    <name="Field" option>value

The `name=` must appear just before `option`, with one space in between. Both `name=` and `option` must be in all lower case. There must be quotes around the field name. There must be a carriage return after the value. Here is an example of a pop-up menu that will work with the webdatabasetoform statement.

    <select size=1 name="Color">
        <name="Color" option>Red
        <name="Color" option>Blue
        <name="Color" option>Green
        <name="Color" option>Orange
        <name="Color" option>Purple
        <name="Color" option>Yellow
        <name="Color" option>Gold
        <name="Color" option>Silver
    </select>

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).
- grabwebformitems -- grabs multiple web form items and stuffs the values into fields and/or variables.
- 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.
- 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

Version | Status | Notes
10.2 | No Change | Carried over from Panorama 6.0.