Not working in IE, but works in netscape - Validation problem
The following Javascript validates all of the input characters in NC, but only the first in IE. Very strange, any thoughts would be greatly appreciated. Thanks.
function valHrs(input)
{
var msg = "Invalid Input, Hours must be between -24 and 24";
var inHrs = input.value;
var min = -24;
var max = 24;
var RefString="1234567890.-";
for (var count = 0; count < inHrs.length; count++) {
var tempchar = inHrs.substring(count, count + 1)
if (RefString.indexOf (tempchar, 0)==-1) {
alert(msg);
input.value = "";
return false;
}
var num = parseFloat(inHrs)
if(num < min ¦¦ max < num){
alert(msg);
input.value = "";
return false;}
input.value = inHrs;
return true;
}
}
John Pollock posted this at 01:57 — 20th October 1999.
He has: 628 posts
Joined: Mar 1999
I can't find a problem at first glance here, but Lloyd may be able to help as he is better in this area. Otherwise, I'll try and get a closer look when I get a chance.
Java Script: A Beginner's Guide
Page Resource
Anonymous posted this at 03:28 — 20th October 1999.
They have: 5,633 posts
Joined: Jan 1970
These type of scripts require a bit more work than most others and I can't see at the moment why it doesn't work. I know what you are trying to achieve so
when I get some time I will look into it a bit further.
----------
[email protected]
http://go.to/hass
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.