Thanks but I have this code and it works in IE, and somewhat in Firefox.
function check_float(e, field) {
//alert(e.keyCode);
var key;
if (window.event) {
key = e.keyCode;
}
else if (e.which) {
key = e.which;
}
//alert(key);
if (!(((key >= 48) && (key <= 57)) || (key == 45) || (key == 46))) {
//if (!(((key >= 48) && (key <= 57)) || (key == 45) || (key == 46) || (key == 8) || (key == 9) || (key == 13) || (key == 17) || (key == 18) || (key == 19) || (key == 33) || (key == 34) || (key == 35) || (key == 36) || (key == 37) || (key == 38) || (key == 39) || (key == 40) || (key == 45) || (key == 46))) {
alert("Only digits, dashes and one decimal point are allowed!");
return false;
}
if (key == 46) {
var patt1 = new RegExp("\\.");
var ch = patt1.exec(field);
if (ch == ".") {
alert("More then one decimal point not allowed");
return false;
}
}
I need to have the user be able to use their backspace key, and the arrow keys and alt+key and ctrl+key, tab key and a lot of other keys and it works in IE but not in FF. The user cannot use the backspace or arrow keys in FF.
Ordinary Programmer