diff --git a/views/bootstrap/class.OverrideContentStatus.php b/views/bootstrap/class.OverrideContentStatus.php index 16f718dea..13a336b68 100644 --- a/views/bootstrap/class.OverrideContentStatus.php +++ b/views/bootstrap/class.OverrideContentStatus.php @@ -33,30 +33,22 @@ class SeedDMS_View_OverrideContentStatus extends SeedDMS_Theme_Style { function js() { /* {{{ */ header('Content-Type: application/javascript; charset=UTF-8'); + parent::jsTranslations(array('js_form_error', 'js_form_errors')); ?> -function checkForm() -{ - msg = new Array(); - if (document.form1.overrideStatus.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({ + rules: { + comment: { + required: true + }, + overrideStatus: { + required: true + }, + }, + messages: { + comment: "", + overrideStatus: "", + }, }); }); getReviewStatus(); $approvalStatus = $content->getApprovalStatus(); + $this->htmlAddHeader(''."\n", 'js'); + $this->htmlAddHeader(''."\n", 'js'); + $this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName())))); $this->globalNavigation($folder); $this->contentStart(); @@ -93,6 +88,7 @@ $(document).ready(function() { array( 'element'=>'textarea', 'name'=>'comment', + 'required'=>true, 'rows'=>4, ) );