Jump to content

Allow only english alphabet letters,underscore,backspace,delete etc in text box?


Vivid Lust

Recommended Posts

How,

 

I'm currently using the following script:

 

<script type="text/javascript">
<!--
function foo(e) {
var allow=' ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_'
     var k;
     k=document.all?parseInt(e.keyCode): parseInt(e.which);
     return (allow.indexOf(String.fromCharCode(k))!=-1);
}
// -->
</script>
<input type="text" onKeyPress="return foo(event)" />	

 

How can I alow delete, backspace, and disable spacebar?

 

Thanks all!!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.