Extends field object with obj.
set(field, obj)

#### Arguments

field | string, name of the field
obj | object, field object { name, type, required }

Returns boolean.

#### Description

This method will find and update the field object in the .fields array. If you change this array, you will need to call .refresh() method to update it on the screen. Note that this does not change the field value, it changes the field object, which contains description of the field. In order to change field value you need to update .records array and then call .refresh() method to update it on the screen.
If you have form defined in the following way: $('#form').w2form({ name : 'form', url : 'server/post', record: { field_1 : 1, field_2 : 2 }, fields: [ { name: 'field_1', type: 'text', required: true }, { name: 'field_2', type: 'alphanumeric', required: true } ] }); // update field object w2ui['form'].set('field_1', { type: 'int' }); w2ui['form'].refresh(); After the update the field_1 becomes an integer field. You could have looped through the .fields array of the form looking for the field and extending it to achieve same results.
If you need to update field value, for the form same as above you can do it in the following way: // update field value w2ui['form'].record['field_1'] = 'new value'; w2ui['form'].refresh();