Checking the form for English characters, if only English characters are entered, then true, if something other than English characters is false. How to fix what would work correctly
"gggg"> true
"pppt"> false
"arff"> true
var a = document.getElementById('form-n'); a.onkeyup = function (e) { var d = a.value; var r = /[az]/gi; console.log(d) if (!r.test(d)) { console.log("false") } else { console.log("true") } }
pppp
false forpppp
- Grundy