For database update heitml supports the dbform component. A dbform displays a form for a given database relation. Using the form, it is possible to enter new records, to search for existing records, and modify or delete existing records.
In order to simplify searches and maintenance, or to present the same data in different contexts, it is often a good idea to store information as part of a database than directly on a Web page. In such cases the owner of the Web site must have a way to edit the database content.
|Tip 1: A dbform can be put on a protected page, thus providing all the necessary functionality.|
The public Web site should then contain components to display the database content in various formats.
Another common application is a feedback or guestbook database where anyone can leave a message. In this case a dbform without modify and delete functions can be used. If the feedback shouldn't be public, search functions should also be disabled. In this case another dbform can be used on a protected page for display and maintenance of the database.
Together with SSL and password protection, it is also possible to create a kind of registration database where everyone can make entries and change them to keep them up to date (e.g. a database of cooperation partners).
The tryout pages contain step by step instructions on
how to put a dbform on a page.
Initially, the form shows up with
several buttons, but without any fields.
Then you can select it in the RADpage window and
Initially, an empty form is displayed.
Then data can be entered and written
to the database by pressing the
|Note: By default, the form contains dbformbutton components. You can delete some buttons if you want to disable certain functions.|
By default, the form contains a table for layout. You can keep that or create a completely different layout.
|Tip 2: Inside the form you can place field components that display database fields. By editing the properties of the field components, you can specify the field layout as well as some checks. In fact, heitml features many different field components that can be used here.|
For internal processing, the primary key of the database relation is needed. With most databases, RADpage automatically finds and sets the key property correctly. You can change this value if necessary, just enter the names of all key fields separated by commas.
|Tip 3: Using the keychange property you can disable changes of the key of a database record.|
A database record form edits a single record from a database relation. Usually the form starts up empty and it does not have a current row. Then a new record can be inserted or an existing record can be searched for by entering some values. After a successful search the row found becomes the current row. It can then be modified or deleted.
|Key||Key field names, separated by comma. If you leave this empty,
|Keychange||Key field change model.|
Value "update" allows updating key fields.
Value "copy" is like "update", but the modify button copies the record if key fields were changed.
Value "none" disallows changing key fields.
|State||Use to disable form fields.|
|Method||HTTP method to submit the form data set.|
Value "post" should be used when form processing causes side effects, e.g. modifies a database, and if the form contains fieldfileupload.
|Enctype||Content type for method "post". Use "multipart/form-data" with fieldfileupload.|
|Successuri||Continue with this URI after the form has been submitted successfully.|
|Fragment||Section name (The # part of the action URI without the #). No effect on successuri.|
|Passwordfield||for password protection: password field name|
|Msgallowed||Accepted messages. The enabled functions can be activated from the browser.|
Database form button used to trigger one of several actions of a dbform. It must be used on a dbform.
The value is used to render the button depending on the button layout. Name must be a unique name for the button inside the form.
|Type||Select the button's action.|
|Src||Image Url, only used for layout=image|
|Border||Border Size, only used for layout=image|
|State||Is button visible and enabled ?|
See Fields for field components to place inside a dbform.