Error messages were outsourced

This commit is contained in:
Loïc Chapeaux
2001-07-07 15:14:40 +00:00
parent 0bae68a09d
commit 8d8e054389
2 changed files with 11 additions and 8 deletions

View File

@@ -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
//-->

View File

@@ -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 = "") {