Commit a615f102 authored by Ad Schellevis's avatar Ad Schellevis

(mvc ui) make validaiton modal message box optional

parent 3c95edd1
...@@ -33,8 +33,10 @@ ...@@ -33,8 +33,10 @@
* save form to server * save form to server
* @param url endpoint url * @param url endpoint url
* @param formid parent id to grep input data from * @param formid parent id to grep input data from
* @param disable_dialog don't show input validation message box on failure
*/ */
function saveFormToEndpoint(url,formid,callback_ok) { function saveFormToEndpoint(url,formid,callback_ok, disable_dialog) {
disable_dialog = disable_dialog || false;
var data = getFormData(formid); var data = getFormData(formid);
ajaxCall(url=url,sendData=data,callback=function(data,status){ ajaxCall(url=url,sendData=data,callback=function(data,status){
if ( status == "success") { if ( status == "success") {
...@@ -43,18 +45,21 @@ function saveFormToEndpoint(url,formid,callback_ok) { ...@@ -43,18 +45,21 @@ function saveFormToEndpoint(url,formid,callback_ok) {
// if there are validation issues, update our screen and show a dialog. // if there are validation issues, update our screen and show a dialog.
if (data['validations'] != undefined) { if (data['validations'] != undefined) {
BootstrapDialog.show({ if (!disable_dialog) {
type:BootstrapDialog.TYPE_WARNING, // validation message box is optional, form is already updated using handleFormValidation
title: 'Input validation', BootstrapDialog.show({
message: 'Please correct validation errors in form', type:BootstrapDialog.TYPE_WARNING,
buttons: [{ title: 'Input validation',
label: 'Dismiss', message: 'Please correct validation errors in form',
action: function(dialogRef){ buttons: [{
dialogRef.close(); label: 'Dismiss',
} action: function(dialogRef){
}] dialogRef.close();
}
}]
}); });
}
} else if ( callback_ok != undefined ) { } else if ( callback_ok != undefined ) {
// execute callback function // execute callback function
callback_ok(); callback_ok();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment