Just set the Character length( Maximum and minimum) of the field, please see the attached Screenshot for reference.Validating form input with Java Script is easy to do and can save a lot of unnecessary calls to the server.The parentheses may include parameter names separated by commas: ( Function parameters are listed inside the parentheses () in the function definition.Function arguments are the values received by the function when it is invoked.Inside the function, the arguments (the parameters) behave as local variables. If the function was invoked from a statement, Java Script will "return" to execute the code after the invoking statement. The return value is "returned" back to the "caller": Since local variables are only recognized inside their functions, variables with the same name can be used in different functions.Local variables are created when a function starts, and deleted when the function is completed.Otherwise a browser with Java Script disabled, or a hacker trying to compromise your site, can easily by-pass client-side validation.
The value of a text input box (or a textarea or password input) is available using the syntax that tells you which option has been selected.
However, it turns out that The is Na N() function determines whether a value is an illegal number (Not-a-Number).
This is done using HTML5 form validation techniques and CSS, but it only validates the input format (pattern) and not the actual values.
That could be done using Ajax, but would make the CAPTCHA much easier to break.