Error messages were outsourced
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
<!--
|
|
||||||
|
|
||||||
var isFormElementInRange;
|
var isFormElementInRange;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -20,7 +18,7 @@ function checkFormElementInRange(theForm, theFieldName, min, max )
|
|||||||
|
|
||||||
// It's not a number
|
// It's not a number
|
||||||
if (isNaN(val)) {
|
if (isNaN(val)) {
|
||||||
alert('This is not a number!');
|
alert(errorMsg1);
|
||||||
isFormElementInRange = false;
|
isFormElementInRange = false;
|
||||||
theField.select();
|
theField.select();
|
||||||
theField.focus();
|
theField.focus();
|
||||||
@@ -28,7 +26,7 @@ function checkFormElementInRange(theForm, theFieldName, min, max )
|
|||||||
}
|
}
|
||||||
// It's a number but it is not between min and max
|
// It's a number but it is not between min and max
|
||||||
else if (val < min || val > max) {
|
else if (val < min || val > max) {
|
||||||
alert(val + ' is not a valid row number!');
|
alert(val + errorMsg2);
|
||||||
isFormElementInRange = false;
|
isFormElementInRange = false;
|
||||||
theField.select();
|
theField.select();
|
||||||
theField.focus();
|
theField.focus();
|
||||||
@@ -40,6 +38,3 @@ function checkFormElementInRange(theForm, theFieldName, min, max )
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} // end of the 'checkFormElementInRange()' function
|
} // end of the 'checkFormElementInRange()' function
|
||||||
|
|
||||||
//-->
|
|
||||||
|
|
||||||
|
10
lib.inc.php3
10
lib.inc.php3
@@ -73,7 +73,15 @@ function show_table_navigation($pos_next, $pos_prev, $dt_result) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function load_javascript () {
|
function load_javascript () {
|
||||||
echo "\n<script language=\"javascript\" src=\"functions.js\" > </script>";
|
?>
|
||||||
|
<script type="text/javascript" language="javascript">
|
||||||
|
<!--
|
||||||
|
var errorMsg1 = '<?php echo(str_replace('\'', '\\\'', $GLOBALS['strNotNumber'])); ?>';
|
||||||
|
var errorMsg2 = '<?php echo(str_replace('\'', '\\\'', $GLOBALS['strNotValidNumber'])); ?>';
|
||||||
|
//-->
|
||||||
|
</script>
|
||||||
|
<script src="functions.js" type="text/javascript" language="javascript"></script>
|
||||||
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
function mysql_die($error = "") {
|
function mysql_die($error = "") {
|
||||||
|
Reference in New Issue
Block a user