Forum Moderators: open

Message Too Old, No Replies

Not working in Netscape7.0

textfield

         

ksvijay

11:16 am on May 24, 2005 (gmt 0)

10+ Year Member



The following code is not working in Netscape7.0,Pls anybody knows reply me, thanks

<html>
<head>
<!--
This file retrieved from the JS-Examples archives
[js-x.com...]
1000s of free ready to use scripts, tutorials, forums.
Author: Brent Thorwall - 0
-->

</head>
<body>

<form>
<INPUT name=txtQty TYPE=text size=6 onkeypress="onlyDigits(event,'noDec')">
<INPUT name=txtPrice TYPE=text size=6 onkeypress="onlyDigits(event,'decOK')">
</form>
<script>
var isIE = document.all?true:false;
var isNS = document.layers?true:false;
function onlyDigits(e,decReq) {
var key = (isIE)? window.event.keyCode : e.which;
var obj = (isIE)? event.srcElement : e.target;
var isNum = (key > 47 && key < 58)? true:false;
var dotOK = (key==46 && decReq=='decOK' && (obj.value.indexOf(".")<0 ¦¦ obj.value.length==0))? true:false;
window.event.keyCode = (!isNum &&!dotOK && isIE)? 0:key;
e.which = (!isNum &&!dotOK && isNS)? 0:key;
return (isNum ¦¦ dotOK);
}

</script>

<BR><center><a href='http://www.js-x.com'>JS-X.com</a></center>
</body>
</html>

orion_rus

7:48 pm on May 25, 2005 (gmt 0)

10+ Year Member



Do you find solution?
If not just ask, i can modify this code for great work)
Good luck to you!