I have 2 password fields…Second field is to make sure that each match each other.
I am using regular expression for validation of the password in the first field (for simplicity pattern=“[a-zA-Z]”.
How would I validate second password input to match the first one in order to receive valid or invalid state?
I don’t think that’s possible without
required, I can simply remove that with my
Inspect Tools option. Then send data empty data or data that you don’t want to your database. So for instance, if you’re looking for only letters in your password. I can simply modify the
You should be validating on the server-side instead.
Yes for sure. I am already doing that. Just wanted to see what I can do if JS is disabled
IMO, you don’t need to do any fancy validations on the client side at all. Doing validations on your server-side is more safer because they cannot modify the server-side codes.
Yes, AFAIK the HTML “validate” only validates the inputs syntax to ensure it’s in the correct format.
This is a good thing for honest users because they will get immediate feedback if they make a mistake. For not so honest users, not so much.
But when it comes down to ensuring validity for all users, that really needs to be done server-side.
like everyone says client side security check is unsafe as it can be disabled or tampered with so to use validation using PHP is a good server side security besides judging from the password thing I’d assume you are using database, So PHP works well with MYSQL so definitely something to look into
You can’t check the two values match on the client side without js, so you will have to rely on the server side to do it, which you should have already.
The built in browser validation only does simple things like required, min/max/ length, patterns, etc.
It won’t do things where different inputs depend upon each other, that needs scripting.
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.