Never rely on JavaScript and client-side validation. Simply because a user can very easily disable or circumvent your client-side validations.
Any user input should treated invalid until validated on the server side.
Client-side validations should be considered as a "nice to have" feature, to increase the UX value of your application (it allows users to detect errors sooner, not having to refill the form). But that's all it is. It's not an alternative to solid server-side validation.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…