guys I am using the following code which works fine on pc but for mobile google chrome browser users are able to use space bar which I have disabled.
<script language="javascript" type="text/javascript">
function check(e) {
var keynum
var keychar
var numcheck
if (window.event) {
keynum = e.keyCode;
}
else if (e.which) {
keynum = e.which;
}
keychar = String.fromCharCode(keynum);
if (keychar == " " || keychar == "'" || keychar == "`" || keychar =="!" || keychar =="@" || keychar =="#" || keychar =="$" || keychar =="%" || keychar =="^" || keychar =="&" || keychar =="*" || keychar =="(" || keychar ==")" || keychar =="-" || keychar =="+" || keychar =="=" || keychar =="/" || keychar =="~" || keychar =="<" || keychar ==">" || keychar =="," || keychar ==";" || keychar ==":" || keychar =="|" || keychar =="?" || keychar =="{" || keychar =="}" || keychar =="[" || keychar =="]" || keychar =="¬" || keychar =="£" || keychar =='"' || keychar =="\\") {
return false;
} else {
return true;
}
}
</script>
other than _ and - I wish nothing for user to enter even copy paste should be disabled.