Fixed problems with Javascript and newlines
This commit is contained in:
parent
a118eeacfc
commit
43ae7c2259
8 changed files with 39 additions and 39 deletions
|
@ -39,20 +39,20 @@
|
||||||
var _alertString="";
|
var _alertString="";
|
||||||
var alertString2;
|
var alertString2;
|
||||||
if (f.categorycode.value.length==0) {
|
if (f.categorycode.value.length==0) {
|
||||||
_alertString += "- categorycode missing\\n";
|
_alertString += "- categorycode missing\n";
|
||||||
}
|
}
|
||||||
// alert(window.document.Aform.description.value);
|
// alert(window.document.Aform.description.value);
|
||||||
if (!(isNotNull(window.document.Aform.description,1))) {
|
if (!(isNotNull(window.document.Aform.description,1))) {
|
||||||
_alertString += "- description missing\\n";
|
_alertString += "- description missing\n";
|
||||||
}
|
}
|
||||||
if (!isNum(f.upperagelimit,0)) {
|
if (!isNum(f.upperagelimit,0)) {
|
||||||
_alertString += "- upperagelimit is not a number\\n";
|
_alertString += "- upperagelimit is not a number\n";
|
||||||
}
|
}
|
||||||
if (_alertString.length==0) {
|
if (_alertString.length==0) {
|
||||||
document.Aform.submit();
|
document.Aform.submit();
|
||||||
} else {
|
} else {
|
||||||
alertString2 = "Form not submitted because of the following problem(s)\\n";
|
alertString2 = "Form not submitted because of the following problem(s)\n";
|
||||||
alertString2 += "------------------------------------------------------------------------------------\\n\\n";
|
alertString2 += "------------------------------------------------------------------------------------\n\n";
|
||||||
alertString2 += _alertString;
|
alertString2 += _alertString;
|
||||||
alert(alertString2);
|
alert(alertString2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,20 +39,20 @@
|
||||||
var _alertString="";
|
var _alertString="";
|
||||||
var alertString2;
|
var alertString2;
|
||||||
if (f.categorycode.value.length==0) {
|
if (f.categorycode.value.length==0) {
|
||||||
_alertString += "- categorycode missing\\n";
|
_alertString += "- categorycode missing\n";
|
||||||
}
|
}
|
||||||
// alert(window.document.Aform.description.value);
|
// alert(window.document.Aform.description.value);
|
||||||
if (!(isNotNull(window.document.Aform.description,1))) {
|
if (!(isNotNull(window.document.Aform.description,1))) {
|
||||||
_alertString += "- description missing\\n";
|
_alertString += "- description missing\n";
|
||||||
}
|
}
|
||||||
if (!isNum(f.upperagelimit,0)) {
|
if (!isNum(f.upperagelimit,0)) {
|
||||||
_alertString += "- upperagelimit is not a number\\n";
|
_alertString += "- upperagelimit is not a number\n";
|
||||||
}
|
}
|
||||||
if (_alertString.length==0) {
|
if (_alertString.length==0) {
|
||||||
document.Aform.submit();
|
document.Aform.submit();
|
||||||
} else {
|
} else {
|
||||||
alertString2 = "Form not submitted because of the following problem(s)\\n";
|
alertString2 = "Form not submitted because of the following problem(s)\n";
|
||||||
alertString2 += "------------------------------------------------------------------------------------\\n\\n";
|
alertString2 += "------------------------------------------------------------------------------------\n\n";
|
||||||
alertString2 += _alertString;
|
alertString2 += _alertString;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,22 +38,22 @@ function Check(f) {
|
||||||
var _alertString="";
|
var _alertString="";
|
||||||
var alertString2;
|
var alertString2;
|
||||||
if (f.itemtype.value.length==0) {
|
if (f.itemtype.value.length==0) {
|
||||||
_alertString += "- itemtype missing\\n";
|
_alertString += "- itemtype missing\n";
|
||||||
}
|
}
|
||||||
if (!(isNotNull(window.document.Aform.description,1))) {
|
if (!(isNotNull(window.document.Aform.description,1))) {
|
||||||
_alertString += "- description missing\\n";
|
_alertString += "- description missing\n";
|
||||||
}
|
}
|
||||||
if ((!isNum(f.loanlength,0)) && f.loanlength.value.length > 0) {
|
if ((!isNum(f.loanlength,0)) && f.loanlength.value.length > 0) {
|
||||||
_alertString += "- loan length is not a number\\n";
|
_alertString += "- loan length is not a number\n";
|
||||||
}
|
}
|
||||||
if ((!isNum(f.rentalcharge,0)) && f.rentalcharge.value.length > 0) {
|
if ((!isNum(f.rentalcharge,0)) && f.rentalcharge.value.length > 0) {
|
||||||
_alertString += "- rental charge is not a number\\n";
|
_alertString += "- rental charge is not a number\n";
|
||||||
}
|
}
|
||||||
if (_alertString.length==0) {
|
if (_alertString.length==0) {
|
||||||
document.Aform.submit();
|
document.Aform.submit();
|
||||||
} else {
|
} else {
|
||||||
alertString2 = "Form not submitted because of the following problem(s)\\n";
|
alertString2 = "Form not submitted because of the following problem(s)\n";
|
||||||
alertString2 += "------------------------------------------------------------------------------------\\n\\n";
|
alertString2 += "------------------------------------------------------------------------------------\n\n";
|
||||||
alertString2 += _alertString;
|
alertString2 += _alertString;
|
||||||
alert(alertString2);
|
alert(alertString2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,13 +38,13 @@
|
||||||
var _alertString="";
|
var _alertString="";
|
||||||
var alertString2;
|
var alertString2;
|
||||||
if (f.tagfield.value.length==0) {
|
if (f.tagfield.value.length==0) {
|
||||||
_alertString += "- tag number missing\\n";
|
_alertString += "- tag number missing\n";
|
||||||
}
|
}
|
||||||
if (_alertString.length==0) {
|
if (_alertString.length==0) {
|
||||||
document.Aform.submit();
|
document.Aform.submit();
|
||||||
} else {
|
} else {
|
||||||
alertString2 = "Form not submitted because of the following problem(s)\\n";
|
alertString2 = "Form not submitted because of the following problem(s)\n";
|
||||||
alertString2 += "------------------------------------------------------------------------------------\\n\\n";
|
alertString2 += "------------------------------------------------------------------------------------\n\n";
|
||||||
alertString2 += _alertString;
|
alertString2 += _alertString;
|
||||||
alert(alertString2);
|
alert(alertString2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,16 +39,16 @@
|
||||||
var _alertString="";
|
var _alertString="";
|
||||||
var alertString2;
|
var alertString2;
|
||||||
if (f.printername.value.length==0) {
|
if (f.printername.value.length==0) {
|
||||||
_alertString += "- printer name missing\\n";
|
_alertString += "- printer name missing\n";
|
||||||
}
|
}
|
||||||
if (f.printqueue.value.length==0) {
|
if (f.printqueue.value.length==0) {
|
||||||
_alertString += "- Queue missing\\n";
|
_alertString += "- Queue missing\n";
|
||||||
}
|
}
|
||||||
if (_alertString.length==0) {
|
if (_alertString.length==0) {
|
||||||
document.Aform.submit();
|
document.Aform.submit();
|
||||||
} else {
|
} else {
|
||||||
alertString2 = "Form not submitted because of the following problem(s)\\n";
|
alertString2 = "Form not submitted because of the following problem(s)\n";
|
||||||
alertString2 += "------------------------------------------------------------------------------------\\n\\n";
|
alertString2 += "------------------------------------------------------------------------------------\n\n";
|
||||||
alertString2 += _alertString;
|
alertString2 += _alertString;
|
||||||
alert(alertString2);
|
alert(alertString2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,13 +39,13 @@
|
||||||
var _alertString="";
|
var _alertString="";
|
||||||
var alertString2;
|
var alertString2;
|
||||||
if (f.word.value.length==0) {
|
if (f.word.value.length==0) {
|
||||||
_alertString += "- word missing\\n";
|
_alertString += "- word missing\n";
|
||||||
}
|
}
|
||||||
if (_alertString.length==0) {
|
if (_alertString.length==0) {
|
||||||
document.Aform.submit();
|
document.Aform.submit();
|
||||||
} else {
|
} else {
|
||||||
alertString2 = "Form not submitted because of the following problem(s)\\n";
|
alertString2 = "Form not submitted because of the following problem(s)\n";
|
||||||
alertString2 += "------------------------------------------------------------------------------------\\n\\n";
|
alertString2 += "------------------------------------------------------------------------------------\n\n";
|
||||||
alertString2 += _alertString;
|
alertString2 += _alertString;
|
||||||
alert(alertString2);
|
alert(alertString2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,16 +38,16 @@
|
||||||
var _alertString="";
|
var _alertString="";
|
||||||
var alertString2;
|
var alertString2;
|
||||||
if (f.variable.value.length==0) {
|
if (f.variable.value.length==0) {
|
||||||
_alertString += "- variable missing\\n";
|
_alertString += "- variable missing\n";
|
||||||
}
|
}
|
||||||
if (f.value.value.length==0) {
|
if (f.value.value.length==0) {
|
||||||
_alertString += "- value missing\\n";
|
_alertString += "- value missing\n";
|
||||||
}
|
}
|
||||||
if (_alertString.length==0) {
|
if (_alertString.length==0) {
|
||||||
document.Aform.submit();
|
document.Aform.submit();
|
||||||
} else {
|
} else {
|
||||||
alertString2 = "Form not submitted because of the following problem(s)\\n";
|
alertString2 = "Form not submitted because of the following problem(s)\n";
|
||||||
alertString2 += "------------------------------------------------------------------------------------\\n\\n";
|
alertString2 += "------------------------------------------------------------------------------------\n\n";
|
||||||
alertString2 += _alertString;
|
alertString2 += _alertString;
|
||||||
alert(alertString2);
|
alert(alertString2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,31 +39,31 @@
|
||||||
var _alertString="";
|
var _alertString="";
|
||||||
var alertString2;
|
var alertString2;
|
||||||
if (f.searchfield.value.length==0) {
|
if (f.searchfield.value.length==0) {
|
||||||
_alertString += "- site name missing\\n";
|
_alertString += "- site name missing\n";
|
||||||
}
|
}
|
||||||
if (f.host.value.length==0) {
|
if (f.host.value.length==0) {
|
||||||
_alertString += "- host missing\\n";
|
_alertString += "- host missing\n";
|
||||||
}
|
}
|
||||||
if (f.port.value.length==0) {
|
if (f.port.value.length==0) {
|
||||||
_alertString += "- port missing\\n";
|
_alertString += "- port missing\n";
|
||||||
}
|
}
|
||||||
if (f.db.value.length==0) {
|
if (f.db.value.length==0) {
|
||||||
_alertString += "- database missing\\n";
|
_alertString += "- database missing\n";
|
||||||
}
|
}
|
||||||
if (isNaN(f.port.value)) {
|
if (isNaN(f.port.value)) {
|
||||||
_alertString += "- port must be a number\\n";
|
_alertString += "- port must be a number\n";
|
||||||
}
|
}
|
||||||
if (isNaN(f.rank.value)) {
|
if (isNaN(f.rank.value)) {
|
||||||
_alertString += "- rank must be a number\\n";
|
_alertString += "- rank must be a number\n";
|
||||||
}
|
}
|
||||||
if (isNaN(f.checked.value) || f.checked.value<0 || f.checked.value>1) {
|
if (isNaN(f.checked.value) || f.checked.value<0 || f.checked.value>1) {
|
||||||
_alertString += "- checked must be 0 or 1\\n";
|
_alertString += "- checked must be 0 or 1\n";
|
||||||
}
|
}
|
||||||
if (_alertString.length==0) {
|
if (_alertString.length==0) {
|
||||||
document.Aform.submit();
|
document.Aform.submit();
|
||||||
} else {
|
} else {
|
||||||
alertString2 = "Form not submitted because of the following problem(s)\\n";
|
alertString2 = "Form not submitted because of the following problem(s)\n";
|
||||||
alertString2 += "------------------------------------------------------------------------------------\\n\\n";
|
alertString2 += "------------------------------------------------------------------------------------\n\n";
|
||||||
alertString2 += _alertString;
|
alertString2 += _alertString;
|
||||||
alert(alertString2);
|
alert(alertString2);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue