문제

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);">

올바른 솔루션이 없습니다

다른 팁

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; }

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top