What do I add to the if statement to check the password characters? To check for the password rules, you should just rely on the regular expressions you have in place already (and strip out the atpos, dotpos usage - that makes it much more complicated than it even needs to be).
The following code shows the implementation of this validate() function.
Now we will see how we can validate our entered form data before submitting it to the web server.
Also, the ‘@’ must not be the first character of the email address, and the last dot must at least be one character after the ‘@’ sign.
In forms when using email ID fields it is a good idea to use client side validation along with your programming language validation.
The following example shows how you can validate an email address for a form.
If the data entered by a client was incorrect or was simply missing, the server would have to send all the data back to the client and request that the form be resubmitted with correct information.
This was really a lengthy process which used to put a lot of burden on the server.
Because the code is stored on the server, server-side validation requires a roundtrip to the server.