Can anybody say me for writing javascript code for textbox key press event such a way that it should allow only alphabets,dot and spaces
Javascript validation code for textbox on press event
Collapse
X
-
-
i have return java script code for textbox ...this is code...it allows only aphabets...but i wat to allow space and dot....wat will be the code.....Originally posted by chinnasrihariHi,
If you wanna Regular exp, i can help you.
Can i have your requirement.
Chinna
<script>
function EnsureNumeric()
{
var a = window.event.ke yCode;
//alert(a);
if((a >= 97 && a <= 122) || (a >= 65 && a <= 90))
return true;
else
return false;
//alert(window.ev ent.keyCode);
//a = 97; z = 122; A= 65; Z= 90
}
</script>
<body>
<input type="text" name="test" onkeypress="ret urn EnsureNumeric() ;">
</body>Comment
-
Originally posted by saloCan anybody say me for writing javascript code for textbox key press event such a way that it should allow only alphabets,dot and spaces
write in the reguler exp validator
following expression
\w+Comment
Comment