You should always perform your check on the server.
What happens if the user somehow submits the form without using Javascript? Then the whole JS check is null and empty. Never trust javascript. This is a very good tool to use to make the site smooth, etc., but you cannot assume that the user will use it, even if you set it to something that you do not allow them to send normally.
When I personally set the check on the client and server side, I try to ensure that they are exactly the same validations. Thus, the user usually does not see the server check, but if something goes wrong, the information is still checked as necessary.
source share