• No results found

Select <select> tag

In document Php Maker 10 (Page 66-68)

Display the field as a combobox ("select-one") or a listbox ("select-multiple").

Size - no. of options to show. If more that 1, the selection list is shown as a listbox, otherwise it is shown as a combobox. Multiple - Check to enable multiple selection (listbox)

Note The submitted values of the multi-selected listbox is a comma-separated string. Therefore you must use a string field for listbox.

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

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 section below). 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 Ajax - specifies if Ajax is used to update the selection list. Validation - see section below

TextArea

<textarea> tag

Display the field as a textarea.

Cols - no. of columns of the textarea Rows - no. of rows of the textarea

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

Use DHTML Editor - replace the textarea with a DHTML editor for editing the data as HTML. See Third-party Tools for more info on DHTML Editors.

File

<input type="file"> tag

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

Size - size of the input tag (NOT file size)

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

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 - Recommended. 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.

Note Do not specify file name field if you want IE to open the file automatically. (IE may fail to open non-image files retrieved from database properly.) Use file name field if you want IE to popup a File Download dialog for user to save the file with the filename specified in the file name field.

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 application root.

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

Upload folder - Folder where the uploaded file will reside. If you do not enter a specific folder, 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. Make sure that the Web server user have read/write access to the folder.

3. The path is relative to application root. Use slashes "/" as path delimiter, no leading slash. e.g. If the application root of your website is C:\Inetpub\wwwroot\demo and you enter "uploads/folder1/" (with double quotes) in this textbox, the folder for the uploaded files will be C:\Inetpub\wwwroot\demo\uploads\folder1. If you are not sure which folder is application root, please read Creating Virtual Directories in IIS.

4. 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.

5. If Multiple is enabled, all upload files use the same upload folder. 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 Note that resizing requires Image Resize extension (for registered users only) and supports GIF, JPEG and PNG images only, click Tools->Extensions from the main menu to enable. The extension requires PHP GD2 extension with GD2, make sure it is installed. See Third-Party Tools.

Validation - see section below

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 normal textbox.

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)

In document Php Maker 10 (Page 66-68)

Related documents