Question

Here is the js code

function isCharKey(evt){

 var charCode = event.keyCode
   if ((charCode > 64  && charCode <91 )|| (charCode >96 && charCode<123) || (charCode==32))
    return true;
    return false;
}

Here is the html code

<label id="exe_form_name">Name:</label><input type="text" name="tbcust_name"  id="name1" onkeypress="return isCharKey(event);">

No correct solution

OTHER TIPS

Change

var charCode = event.keyCode

to

var charCode = evt.keyCode

function isCharKey(evt) {

var charCode = evt.keyCode if ((charCode > 64 && charCode <91 )|| (charCode >96 && charCode<123) || (charCode==32)) return true; return false; }

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top