-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Your regex here should not just be called regex. That doesn't give me as a code reviewer a lot of extra information.
It would be much better if you isolated it in its own function with a good name e.g.
function isSpecialCharacter(string) {
return string.match('[?<>=+()*&^%$£@!#:;``~{}\[|_\\\]]')
}
form.addEventListener('keypress', function(e) {
if (isSpecialCharacter(e.key)) {
e.preventDefault();
}
});Metadata
Metadata
Assignees
Labels
No labels