diff --git a/views/bootstrap/class.AddSubFolder.php b/views/bootstrap/class.AddSubFolder.php index 105a1145c..c7c142ca3 100644 --- a/views/bootstrap/class.AddSubFolder.php +++ b/views/bootstrap/class.AddSubFolder.php @@ -35,37 +35,7 @@ class SeedDMS_View_AddSubFolder extends SeedDMS_Bootstrap_Style { $strictformcheck = $this->params['strictformcheck']; header('Content-Type: application/javascript'); ?> -function checkForm() -{ - msg = new Array(); - if (document.form1.name.value == "") msg.push(""); - - if (document.form1.comment.value == "") msg.push(""); - - if (msg != "") { - noty({ - text: msg.join('
'), - type: 'error', - dismissQueue: true, - layout: 'topRight', - theme: 'defaultTheme', - _timeout: 1500, - }); - return false; - } - else - return true; -} $(document).ready( function() { -/* $('body').on('submit', '#form1', function(ev){ - if(checkForm()) return; - ev.preventDefault(); - }); -*/ $("#form1").validate({ invalidHandler: function(e, validator) { noty({ @@ -77,6 +47,12 @@ $(document).ready( function() { timeout: 1500, }); }, + highlight: function(e, errorClass, validClass) { + $(e).parent().parent().removeClass(validClass).addClass(errorClass); + }, + unhighlight: function(e, errorClass, validClass) { + $(e).parent().parent().removeClass(errorClass).addClass(validClass); + }, messages: { name: "", comment: "" diff --git a/views/bootstrap/class.EditDocument.php b/views/bootstrap/class.EditDocument.php index b7832b542..4dbcefbfa 100644 --- a/views/bootstrap/class.EditDocument.php +++ b/views/bootstrap/class.EditDocument.php @@ -36,41 +36,7 @@ class SeedDMS_View_EditDocument extends SeedDMS_Bootstrap_Style { header('Content-Type: application/javascript'); $this->printKeywordChooserJs('form1'); ?> -function checkForm() -{ - msg = new Array(); - if ($("#name").val() == "") msg.push(""); - - if ($("#comment").val() == "") msg.push(""); - if ($("#keywords").val() == "") msg.push(""); - - if (msg != "") - { - noty({ - text: msg.join('
'), - type: 'error', - dismissQueue: true, - layout: 'topRight', - theme: 'defaultTheme', - _timeout: 1500, - }); - return false; - } - else - return true; -} - $(document).ready( function() { -/* - $('body').on('submit', '#form1', function(ev){ - if(checkForm()) return; - ev.preventDefault(); - }); -*/ $("#form1").validate({ invalidHandler: function(e, validator) { noty({ diff --git a/views/bootstrap/class.EditFolder.php b/views/bootstrap/class.EditFolder.php index 7c403dbd7..04c5fee63 100644 --- a/views/bootstrap/class.EditFolder.php +++ b/views/bootstrap/class.EditFolder.php @@ -35,38 +35,7 @@ class SeedDMS_View_EditFolder extends SeedDMS_Bootstrap_Style { $strictformcheck = $this->params['strictformcheck']; header('Content-Type: application/javascript; charset=UTF-8'); ?> -function checkForm() -{ - msg = new Array(); - if (document.form1.name.value == "") msg.push(""); - - if (document.form1.comment.value == "") msg.push(""); - - if (msg != "") { - noty({ - text: msg.join('
'), - type: 'error', - dismissQueue: true, - layout: 'topRight', - theme: 'defaultTheme', - _timeout: 1500, - }); - return false; - } - else - return true; -} $(document).ready(function() { -/* - $('body').on('submit', '#form1', function(ev){ - if(checkForm()) return; - ev.preventDefault(); - }); -*/ $("#form1").validate({ invalidHandler: function(e, validator) { noty({ @@ -78,6 +47,12 @@ $(document).ready(function() { timeout: 1500, }); }, + highlight: function(e, errorClass, validClass) { + $(e).parent().parent().removeClass(validClass).addClass(errorClass); + }, + unhighlight: function(e, errorClass, validClass) { + $(e).parent().parent().removeClass(errorClass).addClass(validClass); + }, messages: { name: "", comment: ""