Submits record data to remote data source for saving.
save([postData], [callBack])

postData | object, Map of additional parameter to submit to remote data source (optional)
callBack | function, call back function when form is reloaded (optional)

Returns undefined.

#### Description

This method should be called when you need to save the record. Often it is linked to a save button. In the example below when user clicks the save button, it will call the .save() method. $('#form').w2form({ name : 'form', recid : 10, url : '/server/form/path', formURL : '/server/path', fields: [ { name: 'first_name', type: 'text', required: true }, { name: 'last_name', type: 'text', required: true }, { name: 'email', type: 'email' } ], actions: { "save": function (target, data) { this.save(); }, "reset": function (target, data) { this.clear(); } } }); This request submits following structure (will be converted to a regular HTTP POST): { cmd : 'save-record', name : 'form', recid : 10, record : { field1 : value1, ... fieldN : valueN } } Please note that the .url property has to be defined for save request to be submitted. If it is not defined, the method will not proceed. The .validate() method is called before form submission. If it return any error the submission will not proceed.

#### Server Response

If there is no error, the server should return the following JSON: { "status": "success" } If there are errors, you can send: { "status": "error", "message": "Error message" }