Field Setup

After loading the database, the database objects (tables, views, custom views, reports and linked tables) will be shown in the left pane (the database pane). Click on any table to go to the Field Setup Page for that table at any time.

Note For simplicity, we use "table" in the following description to refer to any of database object in the project. A database object can be either a table, a view, a Custom View, a report or a Linked Table.

PHPMaker support most commonly used data types. If PHPMaker finds any unsupported fields in a table, an Unsupported Fields tab will appear. You can click on the tab to view the list of fields that are not supported.

The Field Setup pages consists of two section. The upper section is a grid showing available options of all fields. The lower section contain two panels, the Edit Tag panel and the View Tag panel for the selected field.

 

The grid consists of the following sections:

 

General

Field Name Field Name (read only). You can select multiple fields by ctrl-clicking or shift-clicking field name(s) in this column and do the follows:

Change Field Display Order by Drag-and-Drop
You can change the field order defined in the database by simple drag-and-drop. Simply select multiple fields, then drag it to where you want. PHPMaker will generate scripts and display records according to this order.

Change Multiple Field Properties
Some field properties allow Multi-Update. You can select multiple fields, then right click and select Set field properties... to update them at the same time.

Custom field order by drag-and-drop

Data Type Data Type (read only)
Size Maximum field length (read only)
Expression The expression for custom field (Custom Fields only). See also Custom Fields.
Caption Field caption to be displayed
Primary Key Primary Key of the table. Composite key is supported.
Important You should use the same primary key as declared in the database, do not change it unless you are absolutely sure that the selected field(s) values are unique. Otherwise a record cannot be located properly and unexpected results may occur.
Page No. Page number of the field. For use with Multi-Page. By default all the fields are in page 1 and Multi-Page is disabled.

Multi-Page is supported for Add/Edit/View/Search pages, you can optionally enable it for each page. Page labels are also supported. See Table Setup.

If Multi-Page is enabled and the page number is 0, the field will appear in all pages.

Note You can multi-select the fields by ctrl-click or shift-click the Field Name column and then right click to set the page number for the selected fields simultaneously.
Auto-Update Value A dynamic value to update the field automatically in Add/Edit pages.

The dropdown list for this setting is preloaded with a few functions for your selection. For example, you may want to record the last modified date of a record, then you can select "CurrentDate". Do not select a function that return values of unmatching data type, for example, you should not select a function that return a non-numeric string for a numeric field.

Notes
  1. This setting will make the field hidden automatically and it overrides the default value in Add page and custom value for Hidden Edit tag in Edit page. (see section below)
  2. You can add your own PHP functions, the function must accept no argument and return a value. You can add your function names (comma separated) for the Advanced Settings Auto-Update values (See Tools - Advanced Settings), e.g. You can enter: (no quotes)
    MyAutoValueFunction1(),MyAutoValueFunction2()
    Then put your functions under server side Global Code section, see Server Events and Client Scripts.

 

List Page

List Show field in list page
Note The setting is also used for Inline/Grid-Add/Edit and Master/Detail-Add/Edit/View.
Card Class CSS class for the field in Multi-column List page. In a Multi-Column List page, each page is shown in a Bootstrap Card. Bootstrap supports card-* classes for contents in cards (see Content types), if not used, fields are shown in a regular format with both caption value. If card-* classes are used, the data can be shown more nicely, e.g.

Card without card-* classes

Card with card-* classes

The following card-* classes are supported: Note Field with the following class will be shown without caption.

card-title Card title. See Titles, text, and links. Field will be shown as the first field.
card-subtitle Card subtitle. See Titles, text, and links. Field will be shown as the second field.
card-text Card text. See Titles, text, and links.
card-img Show the field as image without caption. The field must be set up with IMAGE View Tag (see below).
card-img-top Show the field as image at the top of the card. See Images. The field must be set up with IMAGE View Tag (see below).
card-img-bottom Show the field as image at the bottom of the card. See Images. The field must be set up with IMAGE View Tag (see below).
Export Include the field when export
Sort Allow sorting by clicking the column header
Aggregate Enable field aggregate. Aggregated values will be shown at table footer. Not applicable in Multi-Column view. Supported values are:
  • TOTAL - Sum of all field values in current page
  • COUNT - Count of records in current page
  • AVERAGE - Average field value in current page
Width Specify CSS width property for field column width. Number, number with unit, or CSS styles are supported, e.g.
Input (no quotes) Output style attribute
200 width: 200px
200px width: 200px
100% width: 100%
min-width: 100px; min-width: 100px;
Note If your table is too wide, browsers will try to best fit the content into screen and the specified width may be overridden.
Wrap Enable/Disable text-wrap for field value. If enabled, style white-space: nowrap; will be added to the table cell.
Note If you enable text-wrap but the field value has no line-breaking points (e.g. spaces or punctuation), the text still cannot be wrapped.
Quick Search Include this field when performing Quick(Basic) Search in the List page.
Note Only text fields and numeric fields are supported in Quick Search. By default only text fields are enabled.
Ext. Search Use this field in Extended Quick Search

Extended Quick Search is enhancement of Quick Search. If a field is checked for Ext. Search, a form element for the field will be shown in the Quick(Basic) Search form and the user input criteria for this field will be included when performing Quick(Basic) Search.

Extended Quick Search will use the same search operators specified under the "Advanced Search Page" section (see below).

Note Extended Quick Search only works with field selected to show in the List page or the search criteria cannot be highlighted (if enabled, see Table Setup) and may confuse some users.
Filter Enable table header filter. If enabled, an Excel style filter will be enabled in the table header of the column, e.g.

Note This setting is mutually exclusive with Ext. Search. If both are enabled, Filter will be used.

 

 

View Page

View Show field in View page
View Tag HTML tag to display the field for viewing (see below for details). Used in List/View pages. You can either click the [View Tag] column and select a View Tag from the drop down box or click the icon on the View Tag panel toolbar to select. After selecting the View Tag, you can further setup its properties in the View tag panel.

 

View Tag

There are two types of View Tag, Formatted Text and Image.

Formatted Text - View Tag to display the field value as formatted text with optional hyperlink.

formatted text

DIV Tag attributes
Style Align - Left/Center/Right/Justify. Align the data.
Italic - Display as Italic
Bold - Display as Bold
Custom Attributes Other custom attributes for the <div> or <span> tag. For example, you can enter as string, e.g. (string with single/double quotes)

"onmouseover='my_js_function();' onmouseout='my_js_function2();'"

or preferably as an array, e.g.

["onmouseover" => "my_js_function();", "onmouseout" => "my_js_function2();"]

Notes
  1. The setting must be a valid PHP expression. If it is string, it should be single/double quoted.
  2. If you use your own JavaScript functions for the client events. You can put your JavaScript functions in the Global Code for client scripts (see Server Events and Client Scripts) so it is available for use in the generated scripts.
  3. Sometimes the generated code already uses some attributes (e.g. onchange event, class attribute, style attribute), if you add the same attribute/event using the string format, there will be more than one event/attributes of the same name and it will be ignored by browsers. But if you add the same attribute using the array format, the attributes will be concatenated together. Therefore, the array format is recommended over the string format.
Format
None No format
Currency Display as formatted currency, format based on locale settings
Date/Time Display as formatted date. Possible values of Date/Time named format are:
  • Default (based on locale settings)
  • DateTime (Date and time, format based on locale settings)
  • Date (Date only, format based on locale settings)
  • Time (Default) Format based on locale settings (e.g. 12-hour with AM/PM for "en-US")
  • Time (HHmm) 24-hour without seconds
  • yMMdd
  • MMddy
  • ddMMy
  • yMMdd HHmmss
  • MMddy HHmmss
  • ddMMy HHmmss
  • yyMMdd
  • MMddyy
  • ddMMyy
  • yyMMdd HHmmss
  • MMddyy HHmmss
  • ddMMyy HHmmss
  • yMMdd HHmm
  • MMddy HHmm
  • ddMMy HHmm
  • yyMMdd HHmm
  • MMddyy HHmm
  • ddMMyy HHmm

where

  • y - A full numeric representation of a year, 4 digits
  • yy - A two digit representation of a year
  • MM - Numeric representation of a month, with leading zeros, 01 through 12
  • dd - Day of the month, 2 digits with leading zeros, 01 to 31
  • HH - 24-hour format of an hour with leading zeros, 00 through 23
  • mm - Minutes with leading zeros, 00 to 59
  • ss - Seconds, with leading zeros, 00 through 59
Notes
  1. Above formats do not include the date or time separator, the actual date or time separator during runtime is determined by locale settings (see Tools -> Locale Settings).
  2. For Default, DateTime, Time(AM/PM) and Time, the date/time format is determined by locale settings. By default the "SHORT" date/time format are used.
Number Display as formatted number, format based on locale settings
Percent Display as formatted percentage, format based on locale settings
Format pattern Custom format pattern for "Currency", "Date/Time", "Number", "Percent". If the default locale pattern does not suit your need, you can enter your custom format.

For "Currency", "Number", "Percent", use ICU DecimalFormat (see the Patterns section for complete information) and Tools -> Locale Settings.

For "Date/Time", use ICU Date/Time Format Syntax.

Note If custom format pattern is specified, it will also be used during editing. Users must input in the same format or the input values cannot be parsed to valid values for databases.
String Format the field value with specified PHP string function (e.g. strtolower) or custom function.

If the string function name is not listed in the dropdown, you can enter your own function name. If the function has one argument only, the argument must be the field value and you only need to enter the function name, e.g. strtolower. If the function has more than one arguments, use {value} to denote that field value, for example, to format a date field by PHP date function, enter:

date(DATE_RFC822, strtotime({value}))

If you want your own functions to be selectable in the dropdown, you can add your function to the following registry:
HKEY_CURRENT_USER\SOFTWARE\PHPMaker\<Version>\Settings\General

e.g. StringFunctions=MyFunction1,MyFunction2

You can put your functions in server side Global Code section, see Server Events and Client Scripts.

Replace CR+LF by <BR> Display the fields with CR+LF replaced by <BR>
Note This setting only applied to memo fields.
Max Length (List page) Truncate the field value at specified max. length and append "..." to the end.
Note This setting only applied to memo fields in list page and must be larger than 0 to take effect.
Hyperlink
HREF field Display the field as hyperlink with the href attribute set to the value of this field. It can be the field itself.
Original field value Use original field value of the Href field in the hyperlink instead of display field value.

If the HREF field has lookup table or user values, by default the display value will be used. If this option is enabled, the original field value will be used instead.

Target Target attribute of the hyperlink. Possible values are: _top, _parent, _self, or _blank. You can also enter your own.
Prefix Prefix added before the HREF field value. You can select one of the options (e.g. "https://"), or you can enter your own partial URL (preceding the HREF field value).
Note This setting is a string to be quoted by double quotes, if you want to use PHP variable, wrap it in { and }. Since { can not be escaped, this syntax will only be recognized when the $ immediately follows the {. Read PHP Strings for more information on parsing variable in string.

For example, you can enter: (no quotes)

mypage?id=

The value of the HREF field will be appended to the end of the your prefix in the outputted HTML.

If you want pass a field value, you can enter: (no quotes)

mypage?myfield={$this->urlEncode($this->MyField->CurrentValue)}&id=

If you need to pass parameters which should not be URL-encoded, for example, if you use Encrypt() to encrypt your parameter, you can enter: (no quotes)

mypage?myfield={$this->raw(Encrypt($this->MyField->CurrentValue))}&id=

Suffix Suffix added after the HREF field value. You can use this setting to append additional URL parameters.

For example, you can enter: (no quotes)

&field2={$this->urlEncode($this->Field2->CurrentValue)}

Note If the suffix is URL parameter(s), you should use & at the beginning of the string.
Custom Attributes Custom attributes for the <a> tag.

For example, you can enter a string, e.g. (string with single/double quotes)

"rel='xxx'"

or preferably as array, e.g.

["rel" => "xxx"]

Notes
  1. The setting must be a valid PHP expression. If it is string, it should be single/double quoted.
  2. If you use your own JavaScript functions for the client events. You can put your JavaScript functions in the Global Code for client scripts (see Server Events and Client Scripts) so it is available for use in the generated scripts.
  3. Sometimes the generated code already uses some attributes (e.g. onchange event, class attribute, style attribute), if you add the same attribute/event using the string format, there will be more than one event/attributes of the same name and it will be ignored by browsers. But if you add the same attribute using the array format, the attributes will be concatenated together. Therefore, the array format is recommended over the string format.
Tooltip
Tooltip field Display the field as tooltip
Tooltip width The width of the tooltip in pixels. Default is 0 (auto).

By default the width is not specified and the width will depend on the field value. However, when the tooltip field is a long text field, the width can take up the browser width, which may be unwanted. Then you can specify a value to limit the width.

Custom View Tag
Custom View Tag Display the field value in List/View page by custom code.
Important Custom View Tag overrides ALL above View Tag settings.

There are some ready-to-use Custom View Tag for you to choose:

  • Google Maps
  • Barcode and QR code
  • YouTube videos

If your data stores information for above, just click the down arrow button to open the setup form, enable one of them, read the notes at the bottom panel carefully, then click the Settings tab to setup, and click OK to save your settings.

Notes
  1. Only one of above Custom View Tag can be selected at a time. All records will use the same Custom View Tag. For instance, you can NOT use Barcode for a record and use Google Maps for next record.
  2. The above Custom View Tags are provided as examples only. The third party tools used are not developed by the author of PHPMaker and are not part of PHPMaker, NO TECHNICAL SUPPORT WILL BE PROVIDED.

You can create your Custom View Tag, they are implemented in exactly the same way as extensions.

If your code is simple and you don't bother creating a Custom View Tag for reuse, you can enter your code directly. Click the [...] button to enter your own code to display the your data in your own PHP, HTML and JavaScript.

Important If you choose to enter your own code, you are completely on your own to display the field value. Intermediate knowledge in PHP, HTML, CSS and JavaScript is required.

Custom View Tag is HTML, if you want to embed PHP code, use <?php and ?>, if you want to use JavaScript, use <script> and </script>.

Note DO NOT use $this in your PHP code. There is no $this in the context, you can use CurrentPage() to get the current page object.
Custom View Tag supports the following tags:
{{{old_tag}}} The old (original) View Tag, that is, the original code for the field. If you need to reuse the original code without changes (e.g. you just add some additional code for the field), you can use the special tag {{{old_tag}}} in your code.

Example

{{{old_tag}}}
...Your code...

{{{value}}} The CurrentValue of the field object. It will converted to <?= $<page>-><field>->CurrentValue ?>. Note that it includes the <?= and ?> tags, use it in HTML only, do not use it in PHP code.
{{{view_value}}} The ViewValue of the field object. It will converted to <?= $<page>-><field>->ViewValue ?>. Note that it includes the <?= and ?> tags, use it in HTML only, do not use it in PHP code.

The above tags are just some helper tags, you can write your own Custom View Tag without using them at all.

Example

Output the field value conditionally:

Example

Output a custom link:

 

Image - View Tag to display data as image or PDF. (Other file types will only be displayed as hyperlinks.) The field should be a BLOB field or a field storing the path of a file.

Image

IMG Tag attributes (For images only)
Width Specify the width of the image in pixels
Height Specify the height of the image in pixels
Alt Specify the alt attribute of the image tag
Note If you use Multi-Language (see PHP Settings), use Multi-Language Property Editor, see Tools for details.
Custom attributes Other custom attributes for the <div> or <span> tag. For example, you can enter: (string with single/double quotes)

"onmouseover='my_js_function();' onmouseout='my_js_function2();'"

or

["onmouseover" => "my_js_function();", "onmouseout" => "my_js_function2();"]

Notes
  1. The setting must be a valid PHP expression. If it is string, it should be single/double quoted.
  2. If you use your own JavaScript functions for the client events. You can put your JavaScript functions in the Global Code for client scripts (see Server Events and Client Scripts) so it is available for use in the generated scripts.
  3. Sometimes the generated code already uses some attributes (e.g. onchange event, class attribute, style attribute), if you add the same attribute/event using the string format, there will be more than one event/attributes of the same name and it will be ignored by browsers. But if you add the same attribute using the array format, the attributes will be concatenated together. Therefore, the array format is recommended over the string format.
Resize image Resize the image to above width and/or height on displaying the image.
Note This feature requires PHP GD extension and supports GIF, JPEG and PNG images only.
Hyperlink, Tooltip and Custom View Tag (same as above)

 

 

Edit Page

Edit Show field in edit page
Note The setting is for Edit page only, NOT for Inline/Grid-Add/Edit and Master/Detail-Add Edit in the List page. See the List setting above.
Title Title to be placed in title attribute of Edit Tag. (see section below) The title will also appear as popup tooltip of the Edit Tag.
Note If you use Multi-Language (see PHP Settings), use Multi-Language Property Editor, see Tools for details.
Read Only Make the field read only in edit page
Note This setting replaces the Edit Tag by a INPUT type=hidden tag and show the field by its View Tag (see above). If you want to set the Edit Tag's readonly attribute (supported by INPUT type=text, INPUT type=password, TEXTAREA), use Row_Rendered server event. If you want to set the Edit Tag's disabled attribute, you can set $this-><field>->Disabled property. (See Server Events and Client Script.)
Edit Tag Form element for the field. Use in Add/Copy/Edit/Search pages (see below for details). You can either click the [Edit Tag] column and select a Edit Tag from the drop down box or click the icon on the [Edit Tag] panel toolbar to select. After selecting the Edit Tag, you can further setup its properties in the Edit Tag panel.

 

Edit Tag

Edit Tags are HTML forms elements for the field in Add/Copy/Edit/Search pages. All HTML form elements are supported:

Text

<input type="text"> tag

Display the field as a textbox.

Type Type of the textbox, see <input> types for details. Supported values are: text, color, email, month, number, range, search, tel, url, week. Default is "text".
Size Size attribute of the textbox, valid for email, tel, and text input types only, see size for details.
Maxlength Maximum input length of the textbox, valid for text, search, url, tel, and email only, see maxlength for details.
Step Step attribute of the textbox, valid for the numeric input types, including number and range, see step for details.
Custom attributes Other custom attributes for the tag. For example, you can enter: (with quotes)

"onmouseover='my_js_function();'"

or

["onmouseover" => "my_js_function();"]

Notes
  1. The setting must be a valid PHP expression. If it is string, it should be single/double quoted.
  2. If you use your own JavaScript functions for the client events. You can put your JavaScript functions in the Global Code for client scripts (see Server Events and Client Scripts) so it is available for use in the generated scripts.
  3. Sometimes the generated code already uses some attributes (e.g. onchange event, class attribute, style attribute), if you add the same attribute/event using the string format, there will be more than one event/attributes of the same name and it will be ignored by browsers. But if you add the same attribute using the array format, the attributes will be concatenated together. Therefore, the array format is recommended over the string format.
Client side events See section below
Use lookup table For use with Auto-Suggest and/or Auto-Fill (see below) with Lookup Table.

Auto-Suggest is Text Edit Tag with a Lookup Table. When user types in the textbox, a dynamic dropdown list populated with data from the lookup table matching the user input will appear for user to select. If the data already exists, the user can easily select without typing the full text. If not, the user can still input as usual. Check Use lookup table to enable Auto-Suggest and then enter the lookup table info in the Lookup Table panel next to the Edit Tag panel. See Lookup Table for more details.

Use modal dialog for lookup For use with Use lookup table. Replaces Auto-Suggest by a modal dialog for selecting a record from the lookup table, see Lookup Table for details. Supports searching, paging and option template (see below).
Note The modal dialog is same for TEXT/SELECT/RADIO/CHEKCBOX.
Lookup page size For use with Use modal dialog for lookup. Specifies the number of records per page in the dialog. If not specified, default is 100, which can be changed in Advanced Settings.
Force selection For use with Auto-Suggest and/or Auto-Fill (see below) with Lookup Table. This setting must be enabled if you want to use Auto-Fill with Auto-Suggest.

When this setting is enabled, the user must select one of the auto-suggested options, the textbox will become similar to a combobox ("select-one"). This setting is usually enabled if the field is a lookup field, i.e. the field stores Link Field values (e.g. primary key) of the Lookup Table.

If this setting is disabled, the form will submit the user input (not the Link Field value) if no suggestion is selected, so make sure user input is acceptable. For example, if the Link field is same as the Display field #1, then disabling this setting should be fine and the field will save one of the suggestion (if selected) or what the user inputs.

If Allow sort/search (see Lookup Table) is enabled, usually the user wants to search the display value rather than the Link field value, so this setting is disabled automatically in the search forms, which will submit the selected suggestion's display value or the user input, and the script will search the display value of the field.

Dropdown min-width (px) Minimum width for dropdown.
Dropdown max-height (px) Maximum height for dropdown.
Option Template Optional JsRender template for options. For use with Auto-Suggest only. See Lookup Table for details.
Check duplicate Specify whether to check duplicate values for the field before editing or inserting a record.

If the field is a unique indexed field, PHPMaker will generate server side code to check duplicate values automatically even this option is not selected. This option is useful when you want to check a non unique indexed fields for duplicated values.

Custom Message Optional custom message to be placed as help text below the input.
Validation See section below
Password

<input type="password"> tag

Display the field as a masked textbox.

Size Size attribute of the textbox
MaxLength Maximum input length of the textbox
Check password strength Check password strength by pStrength. See Third-party Tools
Generate password Generate password by pGenerator. See Third-party Tools
Custom attributes Same as above (see Text Edit Tag)
Client side events See section below
Check duplicate Same as above (see Text Edit Tag)
Custom Message Optional custom message to be placed as help text below the input.
Validation See section below
Radio

<input type="radio"> tag

Display the field as a radio button list.

Custom attributes Same as above (see Text Edit Tag)
Client side events See section below
Use lookup table Use an existing lookup table instead of user input value/label pairs for the radio buttons. To enable this feature, check this option and enter the lookup table info in the [Lookup Table] panel next to the [Edit Tag] panel. See Lookup Table for details. If you don't use lookup table, you can enter the options manually in the [User Value] panel next to the [Edit Tag] panel.
Use modal dialog for lookup For use with Use lookup table. Replaces radio buttons by a modal dialog for selecting a record from the lookup table, see Lookup Table for details. Supports searching, paging and option template (see below).
Note The modal dialog is same for TEXT/SELECT/RADIO/CHEKCBOX, while it has the same functionality of allowing user to select a record from the lookup table, it is NOT a radio button list (or dropdown, see below) anymore.
Lookup page size For use with Use modal dialog for lookup. Specifies the number of records per page in the dialog. If not specified, default is 100, which can be changed in Advanced Settings.
Repeat columns Specifies the no. of radio boxes per row
Use dropdown Show the options in dropdown panel, e.g.

Note If Repeat columns is 1 (single column), the options will be displayed similar to Select Edit Tag (see below), then it is recommended that you use Select Edit Tag directly.
Dropdown min-width (px) Minimum width for dropdown.
Dropdown max-height (px) Maximum height for dropdown.
Option Template Optional JsRender template for options. See Lookup Table for details.
Check duplicate Same as above (see Text Edit Tag)
Custom Message Optional custom message to be placed as help text below the input.
Validation See section below
Checkbox

<input type="checkbox"> tag

Display the field as a checkbox list.

Note For MySQL, PHPMaker considers enum('Y','N') and enum('1','0') as boolean fields. For Oracle, fields with two and only two User Values (see below) and the labels and values are "Y" and "N" (or "1" and "0") will be considered as boolean fields. PHPMaker will display a boolean field by a checkbox automatically.
Custom attributes Same as above (see Text Edit Tag)
Client side events See section below
Use lookup table Use an existing lookup table instead of user input value/label pairs for the checkboxes. To enable this feature, check this option and enter the lookup table info in the [Lookup Table] panel next to the [Edit Tag] panel. See Lookup Table for details. If you don't use lookup table, you can enter the options manually in the [User Value] panel next to the [Edit Tag] panel.
Use modal dialog for lookup For use with Use lookup table. Replaces checkboxes by a modal dialog for selecting multiple records from the lookup table, see Lookup Table for details. Supports searching, paging and option template (see below).
Note The modal dialog is same for TEXT/SELECT/RADIO/CHEKCBOX, while it has the same functionality of allowing user to select multiple records from the lookup table, it is NOT a checkbox list (or dropdown, see below) anymore.
Lookup page size For use with Use modal dialog for lookup. Specifies the number of records per page in the dialog. If not specified, default is 100, which can be changed in Advanced Settings.
Repeat columns Specifies the no. of checkboxes per row
Use dropdown Show the options in dropdown panel, e.g.

Note If Repeat columns is 1 (single column), the options will be displayed similar to Select Edit Tag (see below), then it is recommended that you use Select Edit Tag directly.
Dropdown min-width (px) Minimum width for dropdown.
Dropdown max-height (px) Maximum height for dropdown.
Option Template Optional JsRender template for options. See Lookup Table for details.
Check duplicate Same as above (see Text Edit Tag)
Custom Message Optional custom message to be placed as help text below the input.
Validation See section below
Note The submitted values of the multi-selected checkboxes is a comma-separated string. Therefore you must use a string field for checkbox list.
Select

<select> tag

Display the field as a dropdown selection list.

Note By default Select2 will be used for <select> tags. However, you can choose to use native <select> tags for single selection (select-one) fields, see the option Use native SELECT tag for select-one fields in Advanced Settings.
Multiple Check to enable multiple selection (listbox)

Require search If enabled, options will only be shown after entering at least one character in the search box. For use with Use lookup table (see below) only.

Custom attributes Same as above (see Text Edit Tag)
Client side events See section below
Use lookup table Use an existing lookup table instead of user input value/label pairs for the checkboxes. To enable this feature, check this option and enter the lookup table info in the [Lookup Table] panel next to the [Edit Tag] panel. See Lookup Table for details. If you don't use lookup table, you can enter the options manually in the [User Value] panel next to the [Edit Tag] panel.
Use modal dialog for lookup For use with Use lookup table. Replaces selection list by a modal dialog for selecting one or multiple records from the lookup table, see Lookup Table for details. Supports searching, paging and option template (see below).
Note The modal dialog is same for TEXT/SELECT/RADIO/CHEKCBOX, while it has the same functionality of allowing user to select one or multiple records from the lookup table, it is NOT a selection list (or dropdown, see below) anymore.
Lookup page size For use with Use modal dialog for lookup. Specifies the number of records per page in the dialog. If not specified, default is 10.
Option Template Optional JsRender template for options. See Lookup Table for details.
Check duplicate Same as above (see Text Edit Tag)
Custom Message Optional custom message to be placed as help text below the input.
Validation See section below
TextArea

<textarea> tag

Display the field as a textarea.

Cols No. of columns of the textarea, see cols for details.
Rows No. of rows of the textarea, see rows for details.
Custom attributes Other custom attributes for the tag.
Client side events See section below
Use HTML editor Replace the textarea with a HTML editor for editing the data as HTML. See Using Extensions and Third-party Tools for more info on HTML editors.
Check duplicate Same as above (see Text Edit Tag)
Custom Message Optional custom message to be placed as help text below the input.
Validation See section below
File

<input type="file"> tag

Display the field as a file upload control. For BLOB fields or string fields only.

By default jQuery File Upload and drop zone will be used and the file input tag will be shown as:

If you don't want to use drop zone and display field as Bootstrap File input, you can disable the option Use drop zone for file upload fields in Advanced Settings.

Note File upload supports displaying thumbnails of uploaded image. The feature requires PHP GD extension and supports GIF, JPEG and PNG images only.

Size Size of the input tag, see size for details. (NOT file size)
Custom attributes Same as above (see Text Edit Tag)
Client side events See section below
Check duplicate Same as above (see Text Edit Tag)
Custom Message Optional custom message to be placed as help text below the input.
Validation See section below

If the field is of BLOB (binary) data type, file is uploaded to the database.

You can also store the information of the uploaded file in the following fields: (for BLOB field only)

File type field - Optional. Useful when you want to response to user browser the exact content type of the data.

File name field - Optional. Useful if you want to use the original filename.

File size field - Optional. Stores the uploaded file size.

Image width field - Optional. For use with images only. Stores the width of the uploaded image.

Image height field - Optional. For use with images only. Stores the height of the uploaded image.

If the field of string type, file is uploaded to a subfolder relative to the project folder.

Multiple - Allow multiple upload, see multiple for details. Field value will be comma separated file names. NOT application to BLOB field.

Accept - The accept attribute defining the file types the file input should accept.

Capture - The capture attribute value is a string that specifies which camera to use for capture of image or video data, if the accept attribute indicates that the input should be of one of those types.

Upload folder - Folder where the uploaded file will reside. If unspecified, all the uploaded files will be put in the global upload folder specified in the PHP tab (see PHP Settings).

Notes
  1. Unlike the global upload folder setting (which is a constant and must be a string without double quotes, see PHP Settings), this field setting must be a valid PHP expression. If it is a string, it must be single or double quoted.
  2. The path can be dynamic. For example, if the upload path varies with some field value, you can refer to other fields by $this->MyField->DbValue. However, you must be very careful when using dynamic folder, make sure the setting is valid as a folder name, i.e. it does not contain some characters which can not be used in a file path on your server. The setting will be evaluated to obtain the upload folder before the file is displayed and before the uploaded file is saved, so your setting should be consistent, do not use random number or current date/time to name the folder. Alternatively, you can also use Row_Rendered, Row_Inserting and Row_Updating server events to set the field object's UploadPath property.
  3. If Multiple is enabled, all upload files use the same upload folder.
  4. The path is relative to project folder. Use slashes "/" as path delimiter, no leading slash. e.g. If the project folder of your website is D:\websites\demo and you enter "uploads/" in this textbox, the folder for the uploaded files will be D:\websites\demo\uploads. If you must use another absolute path, use the Advanced Setting File upload path for temporary files.
  5. If you want to use remote folders (e.g. AWS S3, Google Cloud Storage, Azure Blob Storage), you need to specify [Filesystem URI](filestorage.html?id=filesystem-uri), e.g. you can enter "s3://my-bucket/" (with quotes and trailing slash). (In this special case, the path is not relative to project folder.) To use AWS S3, Google Cloud Storage, Azure Blob Storage, read [File Storage](filestorage.html) for details..
  6. Make sure that the web server user have read/write access to the folder. If you use S3 bucket, note that the uploaded files in the bucket are not public by default. Remember to configure bucket permissions so that the uploaded files are accessible by users.

Resize image - Optionally resize the image to resize width and/or height.

Resize width - Width of the resized image

Resize height - Height of the resized image

Note Resizing requires PHP GD extension and supports GIF, JPEG and PNG images only.

Allowed file types - Comma separated file extensions (e.g. jpg,png,gif) without spaces and quotes. If not specified, the global setting (see PHP Settings -> General Options -> File Upload) will be used.

Note For security, the field-specific Allowed file types must be included in the allowed file types under PHP Settings -> General Options -> File Upload.

Max file size (bytes) - The maximum allowed file size in bytes. (Requires browsers supporting the File API.) If not specified, the global setting (see PHP Settings -> General Options -> File Upload) will be used.

Max number of files - The maximum number of files that are allowed to be uploaded if Multiple (see above) is enabled. It must be larger than 1. (If you just allow one file, disable Multiple.) If not specified, unlimited file uploads are allowed. Since file names are stored as comma separated value in the field, the max number of files is also limited by the field size defined in the database.

Hidden

<input type="hidden"> tag

Hide the field with a hidden form element.

Note This is different from de-selecting the field in the Edit column. If a field is de-selected, no code will be generated for the field in the Edit page and the field will not be updated. With a hidden form element the field is not seen but it may still get updated.

Custom value - by default the 'value' attribute contains the field value, custom value is used to update the field with another value when a record is updated using the Edit page.

Notes
  1. Custom value is used in Edit page only. It cannot be used with Read-only fields, User ID fields and Detail fields (Foreign key fields).
  2. In Add page, if a default value is specified (see section below), hidden form element will also be used but the 'value' attribute will contain the default value. If default value is not specified, the field will be displayed as a textbox (with optional modal lookup).
  3. Other preferable ways of updating a hidden field is to use Auto-Update Value (see above) or to use Row_Inserting and/or Row_Updating server events.

Custom attributes - same as above (see Text Edit Tag)

Custom Edit Tag
Custom Edit Tag Display the field value in Add/Edit/Search pages by custom code.
Important
  1. Custom Edit Tag overrides ALL above Edit Tag settings.
  2. Custom Edit Tag is only a provision for your own code or your own implementation of third party tools. If you choose to enter your own code, you are completely on your own to edit the field value. Intermediate knowledge in PHP, HTML, CSS and JavaScript is required. NO TECHNICAL SUPPORT WILL BE PROVIDED for any third-party tools.
  3. Only one Custom Edit Tag can be selected at a time. All records will use the same Custom Edit Tag. You cannot use a Custom Edit Tag for a record and use another Custom Edit Tag for next record.
  4. The sample Custom Edit Tag is provided as examples only. The third party tools used is not developed by the author of PHPMaker and is not part of PHPMaker, NO TECHNICAL SUPPORT WILL BE PROVIDED.

To use Custom Edit Tag, click the down arrow button to open the setup form, enable one of them, read the notes at the bottom panel carefully, then click the Settings tab to setup, and click OK to save your settings.

You can create your own Custom Edit Tag, they are implemented in exactly the same way as extensions.

If your code is simple and you don't bother creating a Custom Edit Tag for reuse, you can enter your code directly. Click the [...] button to enter your own code to display the your data in your own PHP, HTML, CSS and JavaScript. You can enter JavaScript and stylesheet paths under Tools -> Scripts & Stylesheets. Note that the paths are global for the whole project, not just for a field, you'll see JavaScript and stylesheet paths required by other fields.

Custom Edit Tag is HTML and PHP, if you want to embed PHP code, use <?php and ?>, if you want to use JavaScript, use <script> and </script>.

Note DO NOT use $this in your PHP code. There is no $this in the context, you can use CurrentPage() to get the current page object.
The following special tags are supported:
{{{old_tag}}} The old (original) Edit Tag, that is, the original code for the field. If you reuse the original code without changes (e.g. you just add some additional code for the field), you can use the special tag {{{old_tag}}} in your code

Example 1 - Add additional code only

{{{old_tag}}}

Example 2 - Reuse original code by <template> tag and JavaScript


{{{tag_id}}} A preset unique id, you can use any other arbitrary id.
{{{id}}} or {{{name}}} The id or name attribute of the HTML element of the field. See above example.
{{{value}}} The CurrentValue of the field object. It will converted to <?= $<page>-><field>->CurrentValue ?>. Note that it includes the <?= and ?> tags, use it in HTML only, do not use it in PHP code.
{{{edit_value}}} The EditValue of the field object. It will be converted to <?= $<page>-><field>->EditValue ?>. Note that it includes the <?= and ?> tags, use it in HTML only, do not use it in PHP code.

Example

{{{view_value}}} The ViewValue of the field object. It will converted to <?= $<page>-><field>->ViewValue ?>. Note that it includes the <?= and ?> tags, use it in HTML only, do not use it in PHP code.
Note If the JavaScript(s) and/or stylesheet(s) are not provided by the Custom Edit Tag itself, make sure the paths are correct and the scripts/stylesheets already exist on the server.

 

Using User Values for Edit Tag (Radio/Checkbox/Select)

For Radio/Checkbox/Select Edit Tags, the default option values are user input values, you can enter as many value/label pairs as you want in the User Values panel next to the Edit Tag panel.

Note For boolean fields, if you use Radio Edit Tag with User Values, the first value/label should be for True and the second for False.

 

Using Lookup Table for Edit Tag (Text/Radio/Checkbox/Select)

In real world applications, the option values usually come from a lookup table in the database. PHPMaker make it very simple to use lookup values for key field values, simple click Use Table, the Lookup Table panel will replace the User Values panel, see Lookup Table for details.

 

Dynamic Selection Lists

PHPMaker supports Dynamic Selection Lists in which child lookup fields' selection list options change dynamically based on option selected in the parent selection list. To setup child lookup fields, click the Child lookup fields... button and the following setup form will be displayed:

Read Tutorial - Dynamic Selection List for more information.

 

Client side events (for Add/Copy/Edit/Search)

You can manipulate fields on the client side quickly with PHPMaker's "fields" jQuery plugin (see Server Events and Client Scripts).

Example 1

Set field values based on current field value

Example 2

Client side calculation based on user input

Note All client side events are generated in the script userevent.js, after changing client side events, remember to re-generate the .js file.

 

Validation (for Add/Copy/Edit/Search)

The data input for each field can be validated using client-side JavaScript.

Validate Supported validation formats are:
  • **Assert** (see section below)
  • Integer
  • Float
  • Range - for validating a range of number
  • Date - for validating date with or without time
  • Time - for validating time with or without seconds
  • Credit card
  • GUID
  • US Phone Number
  • US Zip Code
  • Email
  • US SSN (social security number)
  • Regular Expression
  • URL
Notes
  1. The actual date/time separator during runtime is determined by locale settings, see Tools -> Locale Settings.
  2. If Regular Expression, client side and server side arguments must be entered, depend on if you have enabled client-side and server-side validation (see PHP Settings), see Arguments (Client-side) and Arguments (Server-side) below.
  3. You can add your own functions for validation. The function must accept at least one argument (the value) and return true (valid value) or false (invalid value). If your functions requires additional arguments, see Arguments (Client-side) and Arguments (Server-side) below. You can add your function names (comma separated) in the Advanced Setting CustomValidationFunctions. (See Tools.) Note that since it is both JavaScript and PHP function name, it must be a string that corresponds to a valid identifier for both sides. For example, you can enter "myValidateFunction1,myValidateFunction2" (no quotes). If you have enabled Client-side (JavaScript) validation (see PHP Settings), you need to provide your JavaScript function. If you have enabled Server-side validation (see PHP Settings), you need to provide your PHP function. You can put your functions in the Global Code section under Server Events and Client scripts respectively (see Server Events and Client Scripts) so they are available for use in the generated scripts.
Arguments (Client-side) Arguments for the JavaScript functions for validation. For Regular Expression and custom validation functions only.
Note This is JavaScript arguments, it should be comma separated (if more than one) JavaScript expressions. e.g. If it is a string, it must be single or double quoted.

If the Validate setting (see above) is Regular Expression, this setting must be a valid JavaScript regular expression pattern along with flags that identify how to apply the pattern (delimit the pattern by "/" characters, not single or double quotes), e.g.

/foobar/i

See Creating a Regular Expression for more information about the pattern and flags.

Arguments (Server-side) Arguments for the PHP functions for validation. For Regular Expression and custom validation functions only.
Note This is PHP arguments, it should be comma separated (if more than one) PHP expressions. e.g. If it is a string, it must be single or double quoted.

If Regular Expression, arguments must be the pattern to search for, as a single or double quoted string, e.g.

'/foobar/i'

See PHP function preg_match for more information about the pattern.

Use date/time picker Check this option to use a JavaScript date/time picker instead of manual input.
Notes
  1. Popup calendar is only available for validation formats Date, you must select the Date format first.
  2. Time picker is only available for Time validation format, you must select the Time format first.
  3. The popup calendar and time picker are not developed by the author of PHPMaker and no technical support will be provided. (See Third-party Tools.)
Required Check this checkbox if the field is mandatory.
Notes
  1. If the field is defined as NOT NULL in your database, the field is required even this option is not enabled. If you do not want to validate NOT NULL field, you can disable the advanced setting
    Validate NOT NULL fields.
  2. By default required fields will be denoted by an asterisk beside the field caption. You can change the asterisk to other or remove it in the language file.
Error message Enter the error message to popup if error occurs.
Note If you use Multi-Language (see PHP Settings), use Multi-Language Property Editor, see Tools for details.

###### The "Assert" Validation Type This special type is server-side only validation based on [symfony/validator](https://symfony.com/doc/current/validation.html). The validator is designed to validate objects against _constraints_. A field value is validated by calling ``validate()`` method of the validator, e.g. To use this validation type, 1. Make sure you have enabled [Server-side validation](phpsetup.html?id=validation). Note that there is NO matching client side validators. 1. Set the **Validation** type as "Assert", 1. Enter **Arguments (Server-side)** as a constraint or an array of constraints, e.g. ``new Assert\Email()``, ``[new Assert\NotBlank(), new Assert\Email()]``. For a full list of the available constraints, see [Validation Constraints Reference](https://symfony.com/doc/current/reference/constraints.html). If the basic constraints do not suit you needs, you can use the more advanced constraints. **Example 1** If you need to create a set of reusable constraints, you can use the [Compound](https://symfony.com/doc/current/reference/constraints/Compound.html) constraint. To add a constraint class, you can use [Custom Files](customfile.html) (see Example 3 on how to add a class to your project). For example, you can create a constraint with your own set of password requirements: then you can create it in **Arguments (Server-side)**, e.g. ``new PasswordRequirements()``. **Example 2** If you want to do custom validation, you can use the [Callback](https://symfony.com/doc/current/reference/constraints/Callback.html) constraint, e.g. then you can create it in **Arguments (Server-side)**, e.g. ``new Assert\Callback([MyValidator::class, 'validate'])``. You can also pass [payload](https://symfony.com/doc/current/reference/constraints/Callback.html#payload) to the ``validate`` method, e.g. ``new Assert\Callback([MyValidator::class, 'validate'], payload: $payload)``. **Note** The Callback constraint also support closure, but it does not support global callback functions nor is it possible to specify a global function or a service method as a callback. You can also create your own custom constraint by extending the base constraint class, but if the constraint doesn't need to be reused consistently everywhere, it is simpler and more flexible to use the validator in [Form_CustomValidate](customscripts.html?id=form_customvalidate) server event for custom validation.

Add Page

Add Show field in add page
Note The setting is for Add page only, NOT for Inline/Grid-Add/Edit and Master/Detail-Add Edit in the List page. See the List setting above.
Default Value Default value for field (for adding new record only) .

The value must be a valid PHP expression. (If it is a string, must be single or double quoted.)

 

Multi-Update Page

Multi-Update Show field in Multi-Update page

If a field is selected, it will be included in the Multi-Update page. In the generated Multi-Update page, there is a checkbox for each field, the field will only be updated if the checkbox is checked so users can update only the checked fields without affecting values of the other unchecked fields.

 

 

Advanced Search Page

Search Show field in Advanced Search page (Note: NOT related to Quick Search)
Operator Search operator #1 for the field. Used in Advanced Search or Extended Quick Search.
Default Value Default value for Search Opr 1.

The value must be a valid PHP expression. (If it is a string, must be single or double quoted.)

Operator 2 Search operator #2 for the field. Used in Advanced Search or Extended Quick Search.
Notes
  1. This second search operators will be useful when you need 2 criteria for the field when searching. You can also select AND/OR to relate the 2 criteria during runtime.
  2. If you want to use "BETWEEN" search operator, select "BETWEEN" as the first search operator. Since "BETWEEN" requires 2 search criteria, when it is used, the second search operator will be ignored.
Default Value 2 Default value for Search Opr 2 .

The value must be a valid PHP expression. (If it is a string, must be single or double quoted.)

 

 

Report Page

Show Show field in report page
Sort Allow sorting by clicking the column header. (Not all fields are sortable.)
Width Specify CSS width property for field column width. Number, number with unit, or CSS styles are supported, e.g.
Input (no quotes) Output style attribute
200 width: 200px
200px width: 200px
100% width: 100%
min-width: 100px; min-width: 100px;
Note If your table is too wide, browsers will try to best fit the content into screen and the specified width may be overridden.
Wrap Enable/Disable text-wrap for field value. If enabled, style white-space: nowrap; will be added to the table cell.
Note If you enable text-wrap but the field value has no line-breaking points (e.g. spaces or punctuation), the text still cannot be wrapped.
Ext. Search Use this field in Extended Quick Search. If a field is checked for Ext. Search, a form element for the field will be shown above the report for searching the report.
Filter Enable table header filter. If enabled, an Excel style filter will be enabled in the table header of the column

 

 

Report (Extended Search)

Operator Search operator #1 for the field. Used in Advanced Search or Extended Quick Search.
Default Value Default value for Search Opr 1.

The value must be a valid PHP expression. (If it is a string, must be single or double quoted.)

Operator 2 Search operator #2 for the field. Used in Advanced Search or Extended Quick Search.
Notes
  1. This second search operators will be useful when you need 2 criteria for the field when searching. You can also select AND/OR to relate the 2 criteria during runtime.
  2. If you want to use "BETWEEN" search operator, select "BETWEEN" as the first search operator. Since "BETWEEN" requires 2 search criteria, when it is used, the second search operator will be ignored.
Default Value 2 Default value for Search Opr 2 .

The value must be a valid PHP expression. (If it is a string, must be single or double quoted.)

 

 

Report (Drilldown)

Detail Report If field value is displayed in a report, you can drill down by setting up a hyperlink linked to a detail report. To setup a detail report, click the "..." to open the Drill Down setup form:

Select a report as detail report, then select the parameters. Select Source Field from the current report and Target Field from the detail report. The report will then build hyperlinks for the field values to pass the selected field values from the current repor to the detail report.

To make the detail report shows meaningful details, you need to pass the required parameters from the current report to the detail report. Select the field values you need to pass, make sure they are sufficient for selecting the relevant records in the detail report. See Tutorial - Drill Down Report.

Parameter If checked, the current report can be used a detailed report and the selected field is a parameter.

Normally you do not need to manually enable this setting, after you set up detail report using the Drill Down setup form, PHPMaker will enable this for the required fields in the detail report.

 

 

Report Settings

There are some more settings for report fields under the Edit Tag panel: 

Grouping Interval If the field is Column Heading field in a Crosstab report and is of date/time type, this property sets the interval for the field values, possible value are:
  • Year
  • Quarter
  • Month
  • Date
  • Date/Time

If the field is a Grouping Level field in a Summary report and is of date/time type, this property sets the interval for the field values, possible value are:

  • Normal (All distinct values)
  • Quarter
  • Month
  • Week
  • Day
  • Hour
  • Minute

If field is a Grouping Level field in a Summary report and is of string type, this property sets the interval for the field values, possible value are:

  • Normal (All distinct values)
  • 1st Letter
  • 2 Initial Letters
  • 3 Initial Letters
  • 4 Initial Letters
  • 5 Initial Letters

If field is a Grouping Level field in a Summary report and is of numeric type, this property sets the interval for the field values, possible value are:

  • Normal (All distinct values)
  • 10s
  • 50s
  • 100s
  • 500s
  • 1000s
  • 5000s
  • 10000s
Year filter If the field is Column Heading field in a Crosstab report and is of date/time type, and the Grouping Interval is Quarter or Month, this setting become available. If unchecked, quarters or months of different year in the report will be displayed together. If checked, a combobox for the available years will be added automatically to the report so user can select which year's data to display.
Delimiter Separated Values If the field is stored as delimiter separated values (e.g. "value1,value2,value3") and you want to split them into separate values during searching, enable this setting.
Note By default, the values must be delimited by commas without spaces.
Relative Days If Ext. Search is enabled and the field is of date/time type, this option add the following filters to the field in Extended Search:
  • Yesterday
  • Today
  • Tomorrow
Notes

To set up Extended Search with this filter, do the follows:

  1. Enable Use lookup table,
  2. In the Lookup Table panel, set Table name as the report itself,
  3. Set the Link field and the Display field #1 as the field itself.
Relative Day Periods If Ext. Search is enabled and the field is of date/time type, this option add the following filters to the field in Extended Search:
  • Last 30 days
  • Last 14 days
  • Last 7 days
  • Next 7 days
  • Next 14 days
  • Next 30 days
Note See notes for Relative Days above.
Relative Weeks If Ext. Search is enabled and the field is of date/time type, this option add the following filters to the field in Extended Search:
  • Last two weeks
  • Last week
  • This week
  • Next week
  • Next two weeks
Note See notes for Relative Days above.
Relative Months If Ext. Search is enabled and the field is of date/time type, this option add the following filters to the field in Extended Search:
  • Last month
  • This month
  • Next month
Note See notes for Relative Days above.
Relative Years If Ext. Search is enabled and the field is of date/time type, this option add the following filters to the field in Extended Search:
  • Last year
  • This year
  • Next year
Note See notes for Relative Days above.
Past / Future If Ext. Search is enabled and the field is of date/time type, this option add the following filters to the field in Extended Search:
  • Past
  • Future
Note See notes for Relative Days above.
Date Interval If Ext. Search is enabled and the field is of date/time type, this option displays the field in Extended Search as a combobox of date intervals. For example, if you select "Year", the combobox will only contain options of years, not options of dates. Possible date intervals are:
  • Year
  • Quarter
  • Month
  • Day
Default Year Default year for the Date Interval combobox. Enter full year (yyyy), e.g. 2008.
Note This setting can also be a valid PHP expression (e.g. a function) which returns the year, e.g. date('Y')
Default Quarter Default quarter for the Date Interval combobox. Possible values are 1-4.
Note This setting can also be a valid PHP expression (e.g. a function) which returns the quarter, e.g. CurrentQuarter()
Default Month Default month for the Date Interval combobox. Possible values are 1-12.
Note This setting can also be a valid PHP expression (e.g. a function) which returns the month, e.g. date('n')
Default Day Default day for the Date Interval combobox. Possible values are 1-31.
Note This setting can also be a valid PHP expression (e.g. a function) which returns the day, e.g. date('j')
Note If you enable a group of filters above but want to disable some of the filters under the group, you can unregister them using Page_FilterLoad server event, see the example in Server Events and Client Scripts.

Also See

[Custom Fields](customfield.html)
[Validation Constraints Reference](https://symfony.com/doc/current/reference/constraints.html)


 ©2002-2025 e.World Technology Ltd. All rights reserved.