If I am defining a function in JavaScript at the top of my page that validates if the string entered in a form is (A-Z,a-z, or 0-9). And then I call that function when they submit it saying :
onsubmit="return Validator(this);"
If the function name is :
function Validator(form)
Why isn't it actually validating the string submitted when we actually click on submit, and is there a better way of validating forms?