mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-10 05:26:06 +00:00
set highlight and unhighligth functions in validato, remove old js code
This commit is contained in:
parent
a34d2d8855
commit
24e34184e8
|
@ -35,37 +35,7 @@ class SeedDMS_View_AddSubFolder extends SeedDMS_Bootstrap_Style {
|
||||||
$strictformcheck = $this->params['strictformcheck'];
|
$strictformcheck = $this->params['strictformcheck'];
|
||||||
header('Content-Type: application/javascript');
|
header('Content-Type: application/javascript');
|
||||||
?>
|
?>
|
||||||
function checkForm()
|
|
||||||
{
|
|
||||||
msg = new Array();
|
|
||||||
if (document.form1.name.value == "") msg.push("<?php printMLText("js_no_name");?>");
|
|
||||||
<?php
|
|
||||||
if ($strictformcheck) {
|
|
||||||
?>
|
|
||||||
if (document.form1.comment.value == "") msg.push("<?php printMLText("js_no_comment");?>");
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
if (msg != "") {
|
|
||||||
noty({
|
|
||||||
text: msg.join('<br />'),
|
|
||||||
type: 'error',
|
|
||||||
dismissQueue: true,
|
|
||||||
layout: 'topRight',
|
|
||||||
theme: 'defaultTheme',
|
|
||||||
_timeout: 1500,
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
$(document).ready( function() {
|
$(document).ready( function() {
|
||||||
/* $('body').on('submit', '#form1', function(ev){
|
|
||||||
if(checkForm()) return;
|
|
||||||
ev.preventDefault();
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
$("#form1").validate({
|
$("#form1").validate({
|
||||||
invalidHandler: function(e, validator) {
|
invalidHandler: function(e, validator) {
|
||||||
noty({
|
noty({
|
||||||
|
@ -77,6 +47,12 @@ $(document).ready( function() {
|
||||||
timeout: 1500,
|
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: {
|
messages: {
|
||||||
name: "<?php printMLText("js_no_name");?>",
|
name: "<?php printMLText("js_no_name");?>",
|
||||||
comment: "<?php printMLText("js_no_comment");?>"
|
comment: "<?php printMLText("js_no_comment");?>"
|
||||||
|
|
|
@ -36,41 +36,7 @@ class SeedDMS_View_EditDocument extends SeedDMS_Bootstrap_Style {
|
||||||
header('Content-Type: application/javascript');
|
header('Content-Type: application/javascript');
|
||||||
$this->printKeywordChooserJs('form1');
|
$this->printKeywordChooserJs('form1');
|
||||||
?>
|
?>
|
||||||
function checkForm()
|
|
||||||
{
|
|
||||||
msg = new Array();
|
|
||||||
if ($("#name").val() == "") msg.push("<?php printMLText("js_no_name");?>");
|
|
||||||
<?php
|
|
||||||
if ($strictformcheck) {
|
|
||||||
?>
|
|
||||||
if ($("#comment").val() == "") msg.push("<?php printMLText("js_no_comment");?>");
|
|
||||||
if ($("#keywords").val() == "") msg.push("<?php printMLText("js_no_keywords");?>");
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
if (msg != "")
|
|
||||||
{
|
|
||||||
noty({
|
|
||||||
text: msg.join('<br />'),
|
|
||||||
type: 'error',
|
|
||||||
dismissQueue: true,
|
|
||||||
layout: 'topRight',
|
|
||||||
theme: 'defaultTheme',
|
|
||||||
_timeout: 1500,
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$(document).ready( function() {
|
$(document).ready( function() {
|
||||||
/*
|
|
||||||
$('body').on('submit', '#form1', function(ev){
|
|
||||||
if(checkForm()) return;
|
|
||||||
ev.preventDefault();
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
$("#form1").validate({
|
$("#form1").validate({
|
||||||
invalidHandler: function(e, validator) {
|
invalidHandler: function(e, validator) {
|
||||||
noty({
|
noty({
|
||||||
|
|
|
@ -35,38 +35,7 @@ class SeedDMS_View_EditFolder extends SeedDMS_Bootstrap_Style {
|
||||||
$strictformcheck = $this->params['strictformcheck'];
|
$strictformcheck = $this->params['strictformcheck'];
|
||||||
header('Content-Type: application/javascript; charset=UTF-8');
|
header('Content-Type: application/javascript; charset=UTF-8');
|
||||||
?>
|
?>
|
||||||
function checkForm()
|
|
||||||
{
|
|
||||||
msg = new Array();
|
|
||||||
if (document.form1.name.value == "") msg.push("<?php printMLText("js_no_name");?>");
|
|
||||||
<?php
|
|
||||||
if ($strictformcheck) {
|
|
||||||
?>
|
|
||||||
if (document.form1.comment.value == "") msg.push("<?php printMLText("js_no_comment");?>");
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
if (msg != "") {
|
|
||||||
noty({
|
|
||||||
text: msg.join('<br />'),
|
|
||||||
type: 'error',
|
|
||||||
dismissQueue: true,
|
|
||||||
layout: 'topRight',
|
|
||||||
theme: 'defaultTheme',
|
|
||||||
_timeout: 1500,
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
/*
|
|
||||||
$('body').on('submit', '#form1', function(ev){
|
|
||||||
if(checkForm()) return;
|
|
||||||
ev.preventDefault();
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
$("#form1").validate({
|
$("#form1").validate({
|
||||||
invalidHandler: function(e, validator) {
|
invalidHandler: function(e, validator) {
|
||||||
noty({
|
noty({
|
||||||
|
@ -78,6 +47,12 @@ $(document).ready(function() {
|
||||||
timeout: 1500,
|
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: {
|
messages: {
|
||||||
name: "<?php printMLText("js_no_name");?>",
|
name: "<?php printMLText("js_no_name");?>",
|
||||||
comment: "<?php printMLText("js_no_comment");?>"
|
comment: "<?php printMLText("js_no_comment");?>"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user