Array of field objects.
Object, default = []
(
NEW in 2.0+) more expressive way to define fields, see
this demo.
For each input or select control in the HTML template of the form, you need to define a corresponding object in the
fields array. A field object has following structure:
Note:
field.html.groupCollapsible is misspelled
field.html.groupCollapsable in w2ui 1.5.0
The form supports all types that $().w2field({}) supports and few more types in addition. The complete list of all types are:
- alphanumeric - text field that only allows alpha numberic characters
- array - builds an array of key/value pairs, uses field.options.keys, field.options.values
- check - list of checkboxes, uses options.items
- checks - alias for check
- checkbox - single checkbox
- color - color picker
- combo - field with auto complete items, user field.options.items
- currency - alias for money
- date - date picker
- datetime - date and time picker
- div - div field, uses field.html.html (same as custom)
- email - email validated field
- enum - multi select element, uses field.options.items
- file - html file input
- float - float number only, uses field.options
- group - type = group is only supported in consturctor
- hex - hex number
- html - just some html instead of the field, uses field.html.html (same as empty)
- int - integer number
- list - drop down list, uses field.options.items
- map - builds a map of unique key/value pairs, uses field.options.keys, field.options.values
- money - number in money format, for international formats seee w2utils.settings
- pass - password field
- password - alias for pass
- percent - number as percenage
- radio - list of radio items, uses field.options.items
- select - html select element, uses field.options.items
- text - any text
- textarea - text area
- time - time picker
- toggle - toggle control, similar to checkbox
If you have a container:
The form definition will be: