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")
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
History
Version | Status | Notes |
10.2 | No Change | Carried over from Panorama 6.0. |