The only single reason for any client-side validation (whether from javascript attributes, an HTML form, or XForm restrictions) is to make it more likely for the right user, and not for entering anything that doesn't make sense.
On the server side, you must do this again for the same reasons, but also for security. You don’t know that client-side validation worked, and even you don’t even know that the request comes from the browser (it takes less than a minute to receive the application for the form, and then resend it with different values, and not much longer if you tried stop it, being smart about what the client sees, used nonces, etc.)
The effects of accepting invalid input can be negligible, but given that since you have a client-side check, then if an invalid input is received, it is more likely that someone with a bad intention is probing you (of course, there might just be a mistake in Client side), so even if you cannot predict any negative consequences when making such an input, it’s still worth blocking it.
This is before we look at whether SQL injections, XSS, or other attacks are possible.
source share