Virgil Venzant wrote:
I am using PHP 4.01, Apache 1.3.12, Redhat Linux 6.2, IE 5.05 and MySql 3.23.xx. running on a Dell PowerEdge 2400. Can anyone tell me why I keep getting the following error from the Javascript code: Error Expected ";"? If I remove all the PHP code everything works fine. I am trying to validate a form, but I am also using PHP to verify each workstation that logs into the server. All of this is taking place on the same page.
<?
header("Cache-control: no-cache, must-revalidate");
header("Pragma: no-cache");
require("common.inc");
?>
<head><title><? echo $string; ?></title>
<script>
function testNumber(form) {
Vartest = isNumber(reroute.start_time.value)
if (vartest == -1) alert("You must enter a Start Time");
}
fuction isNumber(String) {
if (String.lenght==0) return(false);
var IntString="1234567890";
for (count=0; count < String.length; count++) {
Temp =String.substring(count, count+1);
if (IntString.Indexof(Temp, 0) == -1)
return(false);
}
return(true);
}
</script>
<form name="reroute" method="post" onSubmit="testNumber(this.form)" action="reroute_time.php">
When someone in the Traffice Management Unit submit a request to reroute traffic, the time, date, timestamp, user's initals, and user requesting the change are submitted to a mysql database.