All we need is an easy explanation of the problem, so here it is.
Isn’t it unnecessary?
Do you know where I can download a validation script like that one in yahoo when you register an account?
How to solve :
I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.
This is simply part of the concept of progressive enhancement, whereby JS provides a mechanism for enhancing the experience for the user, if it’s there and turned on, and hopefully makes their interaction with your site pleasant, or, at least, minimally irritating.
Edited in response to OP’s question regarding ‘where to download a JS validation tool.’
While I can’t -necessarily- recommend any one library (I tend to write my own as required, or borrow from previously self-written examples), a Google search threw these options up:
- Stephen Walther’s page, discussing Microsoft’s CDN and jQuery-validation, linking to jQuery Validation plug-in:
- jQuery.validate (hosted at MS’ ajax.microsoft.com subdomain)
- jQuery validate plug-in homepage (bassistance.de).
(for example he may not have JS support in web browser), thus always validate on the server side.
… as courtesy to the users pretty much. Makes life easier for the ordinary users that simply commit human things from time to time.
I recommend you using unified server-side and client-side validation using a framework, since it may avoid confronting the user to data valid on client side but rejected by the server, or the opposite (client side too restrictive).
Following list of framework give information about server/client side validation:
It’s a matter of whether you want your form (and website as a whole) to be interactive-cum-user-friendly or not. You can just let the server-side do the validations and throw the error back to the users but that would be less interactive and less user-friendly than warning the users before they submit the form (although you still need to validate the inputs on server-side no matter what). Just my 2 cents 😛
This will make interaction or user friendly site nad reduce reloading page many times in case user submit wrong data
Yes, it is best practice to validate the user input values from both sides client and server side ,
To my mind, only client-side-checking of form input does not work because of security. Imagine you want to check a user password(if “yourpwd” == userinput), with js the user will see the password because it is in the browser-sourcecode .With php, it is not visible because php is for some reason hidden.
Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂