|When editing, display checkbox, radio or submit buttons for selected fields|
You can display a field as a set of lists items (popups and multiple select), check boxes, radio buttons or submit buttons using this property. The mustFill property is ignored if this property is set.
Legal values for input types are: select, multiple, checkbox, radio, submit, combo, readonly.
Display as a drop down list (popup)
Display as a multiple select list.
There are 2 types of checkboxes:
First are numeric/boolean checkboxes where you can toggle the checkbox on or off.
Second are multiple selection checkboxes. This works in conjunction with lookupLens which provide the lookup options, and the displaySep property which controls how each selection is used. See an example below.
Checkbox options are saved as comma separated items in the field. To use some other separator, modify the displaySep field.
Radio buttons allow you to select one item only. If you require this to be must fill field, use a popup instead.
Submit buttons are useful for approval/workflow forms and surveys. Say you have an approval screen with 3 buttons, Approve, Decline and Send Back. We then have the following code:
$lens->lookupLens = 'status=^Approve/Decline/Send Back';
$lens->inputTypeLens = 'status^submit';
Clicking on any of the buttons will save the "Approve", "Decline" or "Send Back" text into the database field status linked to these set of buttons.
This is a combination of an input text field and a popup where values can be selected. Useful when you have a set of standard values (defined in the popup), but you want to be able to enter strings that do not match the standard values also.
The cell value is stored in an input text field that is read-only. This is useful when you have a searchLookupLens that changes multiple fields, but you do not want the user to modify the fields directly. This differs from the readOnlyLens where the value is stored as text, with no input field and no data is posted on form submission. Available since 3.1.
Number of Columns for Checkboxes and Radio-buttons
Since phpLens 2.7.0, you can determine the number of columns to display for check boxes and radio buttons. In this example, the 3 means use 3 columns.
$lens->inputTypeLens = 'Col1^checkbox^3';
# To select all the cities i like by clicking on multiple checkboxes
# and then save them into the Cities_I_Like column in the format:
# "Bukina Faso, London, Verona"
$lens->displaySep = ', ';
$lens->lookupLens = 'select distinct cityname from citylist';
$lens->inputTypeLens = 'Cities_I_Like^checkbox';
# to select only one city from 'NY,Moscow,Beijing':
$lens->lookupLens = 'Cities_I_Like^==NY/Moscow/Beijing';
$lens->inputTypeLens = 'Cities_I_Like^radio';
# to select only one US state, and you want the user to save time
# by not having to click on the default Save button (which is hidden).
# We show the state names, but save as state codes ( a mapping):
$lens->lookupLens = 'State^=AR/Arkansas/CA/California/NY/New York';
$lens->inputTypeLens = 'State^submit';
Basic:Yes Advanced/Enterprise:Yes DynamicEdit:Yes [Version 1.2]