Called before form submits request for record data.
onRequest = function(event)
This event is triggered before form requests record data. If you want to add an event after data is returned, see .onLoad event. These two events are called when the form requests data from the server, not when user clicks the save button.
You can add event listener during the object creation: $('#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 } ], onRequest: function(event) { console.log(event); } }); or after the object has been created: w2ui.form.on('request', function(event) { console.log(event); }); The event handler is called before the default action of the event is triggered. You can cancel the default action by calling event.preventDefault(). To perform an action after the event is fully processed, define event.onComplete function.
See events page in utilities for more details.