Please enable JavaScript to view this site.

Navigation: Advanced topics > Programming topics > JavaScript API > Examples

How to ask for confirmation before saving record

Scroll Prev Next More

 

To ask a user for a confirmation before saving a record, use the following code in the JavaScript OnLoad event for the Edit or Add page.

 

this.on('beforeSave', function(formObj, fieldControlsArr, pageObj){
if (confirm('Save record?')){
return true;
}else{
Runner.delDisabledClass ( pageObj.saveButton );
return false;
}
});

See also:

JavaScript API: RunnerPage object

About Dialog API

Event: Before record added

Events: Before record updated

Events: JavaScript OnLoad

JavaScript API