Set default values for form fields

When working with different fields, you can usually specify a default value to be displayed in the page, or even to be used when performing transactions. Both the Insert and Update transactions allow the user define a default value for each field involved in the transaction. And since MX Kollection 3 is all about dynamic web development, it allows two ways of defining dynamic data as default values, depending on the user interface: you can add dynamic data by using the InterAKT Dynamic Data blue lightning bolt (when displayed next to a field), or the Dreamweaver Dynamic Data yellow lightning bolt to use dynamic values as defaults.

Next to the default value text-box there is usually the lightning icon, that opens a dialog box allowing the developer select a dynamic value, either from an existing recordset, or a session variable. The dialog box that opens when pressing the lightning bolt is similar to the following image:

 

The number and names of the recordset and other variables, depend of the particular site page.

When you select a recordset field, or another variable through a Dynamic Data dialog, in the default Value text-box the actual code that will retrieve it is inserted, specific for the selected server model.

For the PHP_MySQL server model, when you select a recordset field as the default value of a form field, the user interface field is automatically populated with the corresponding PHP code: