URL to the remote data source.
String or Object, default = ''
If the .url property is defined and .recid property is not 0, the form will attempt to load record data from the remote data source. The data will be loaded into the .record object and a copy into .original object.
You can defined URL as a string: $('#form').w2form({ name : 'form', recid : 10, url : '/server/url', formURL : '/server/path', fields: [ { name: 'first_name', type: 'text', required: true }, { name: 'last_name', type: 'text', required: true }, { name: 'email', type: 'email' } ], record: { first_name : 'John', last_name : 'Doe', email : 'jdoe@email.com' }, actions: { "save": function () { this.validate(); }, "reset": function () { this.clear(); } }, postData: [ param1 : 'value1', param2 : 'value2' ] }); Or you can defined different URL for retrieving and saving the record: $('#form').w2form({ name : 'form', recid : 10, url : { get : '/server/url/to/get', save : '/server/url/to/save' }, formURL : '/server/path', fields: [ { name: 'first_name', type: 'text', required: true }, { name: 'last_name', type: 'text', required: true }, { name: 'email', type: 'email' } ], record: { first_name : 'John', last_name : 'Doe', email : 'jdoe@email.com' }, actions: { "save": function () { this.validate(); }, "reset": function () { this.clear(); } }, postData: [ param1 : 'value1', param2 : 'value2' ] }); You can change this property during run-time w2ui['form'].url = 'another/server/url'; w2ui['form'].reload();

### JSON Structures

If the .recid property is not set, no request will be made. Otherwise, the form will submit the following JSON structure; { cmd : 'get-record', // command name : 'form', // name of the form recid : xx // recid of the form } Plus any additional parameters you specified in .postData object. The form will expect back a JSON structure in the following format: { status: 'success', record: { field1 : value1, ... fieldN : valueN } } where field1 should match the names in .fields property.
If you want to return an error, you can return it in the following format: { status: 'error', message: 'Error message' } If you call the .save() method the form will submit the following JSON structure: { cmd : 'save-record', // command name : 'form', // name of the form recid : x, // recid of the form record : { // record of the form field1 : value1, ... fieldN : valueN } }