Commit a615f102 authored by Ad Schellevis's avatar Ad Schellevis

(mvc ui) make validaiton modal message box optional

parent 3c95edd1
......@@ -33,8 +33,10 @@
* save form to server
* @param url endpoint url
* @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);
ajaxCall(url=url,sendData=data,callback=function(data,status){
if ( status == "success") {
......@@ -43,6 +45,8 @@ function saveFormToEndpoint(url,formid,callback_ok) {
// if there are validation issues, update our screen and show a dialog.
if (data['validations'] != undefined) {
if (!disable_dialog) {
// validation message box is optional, form is already updated using handleFormValidation
BootstrapDialog.show({
type:BootstrapDialog.TYPE_WARNING,
title: 'Input validation',
......@@ -55,6 +59,7 @@ function saveFormToEndpoint(url,formid,callback_ok) {
}]
});
}
} else if ( callback_ok != undefined ) {
// execute callback function
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