Array of field objects.
Object, default = []
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: field : { name : '', // name of field, must match name of input or select type : null, // type of field (same types as for w2field object) options : {}, // additional options for the field required : false, // required or not html : { // info for auto generation (see generateHTML) caption : '', // caption for the field attr : '', // attributes inside input/select control text : '', // text to display on the right from the control span : undefined, // number of span, will be added to class="w2ui-span{span}" page : undefined, // page number if there are tabs in the form column : undefined // column number } } The form supports all types that $().w2field({}) supports and few more types in addition. The complete list of all types are:

- text
- textarea
- email
- pass
- password
- int
- float
- money
- currency (alias for money)
- percent
- hex
- alphanumeric
- color
- date
- time
- list
- combo
- enum
- file
- select
- radio
- checkbox
- toggle

If your HTML template is defined as : <div class="w2ui-page page-0"> <div class="w2ui-field w2ui-required"> <label>First Name</label> <div><input name="first_name" type="text" /></div> </div> <div class="w2ui-field w2ui-required"> <label>Last Name</label> <div><input name="last_name" type="text" /></div> </div> <div class="w2ui-field"> <label>Comments</label> <div><input name="field_textarea" type="text" /></div> </div> </div> <div class="w2ui-buttons"> <button name="reset" class="w2ui-btn">reset</button> <button name="save" class="w2ui-btn w2ui-btn-green">save</button> </div> And you have a container: <div id="form" style="width: 500px; height; 300px"></div> The form definition will be: $('#form').w2form({ name : 'form', fields : [ { name: 'first_name', type: 'text' }, { name: 'last_name', type: 'text' }, { name: 'field_textarea', type: 'text' } ], actions : { "reset": function () { this.clear(); }, "save": function () { this.save(); } } }); Please note that the name of the input control in the HTML template must match the name of the field. (case-sensitive). See fields section for more information about field types.