How to validate html forms?
Username and password have to be validated server side, because otherwise they can just look at your code and see what the correct values should be. Generally speaking, though, you can prevent forms from being submitted with Javascript, or at least mark them as invalid, as the user above has said. However, this should not be relied upon, as one does not need to use your web page to submit the values required, and even if one does, they can simply edit the page source to bypass the validations. (Consider firebug, for example) Basically, in-page validation (usually called live validation) is for the user’s benefit, but not to be relied upon for security. For security, all validations should be implemented on the server upon receiving the form data. Your particular example of username and password is called authentication, I would expect that most web frameworks should provide you with libraries for authenticating users. In rails (the web framework I code in) there are two commonly used l