Be Humble... Be Nice.
Bear Bibeault wrote:Regardless of whether client validation happens or not, submitted data should always be validated on the server. Always.
Be Humble... Be Nice.
Arjun Reddy wrote:The main purpose of client side JavaScript validation is to lessen the burden on the server.
No. Always validate on the server. Validate on the client to make your application nicer to use. Period.Or is it like, check the browser and see if JavaScript is enabled and if it is, do JavaScript validation else do the validation on the server side?
I have some other JavaScript written and the browser has JavaScript disabled. What should I do then as a JavaScript programmer?
Ernest Friedman-Hill wrote:[ Edit: Man, Bear is fast. ]
Be Humble... Be Nice.
Arjun Reddy wrote:
Oh, so you meant for example check for the phone number to be of 9 numbers length, check if a valid email id is specified etc... on the client side but validate the login info when the user tries to login to the website on the server side. Right?
Arjun Reddy wrote:
Also, is there a way I can show a message asking the user to enable his JavaScript?
Arjun Reddy wrote:Oh, so you meant ... on the client side but validate the login info when the user tries to login to the website on the server side. Right?
Sure. Put the message in an HTML construct that you hide or remove with JavaScript. No JavaScript and the tag stays put. You can also investigate the <noscript> tag.Also, is there a way I can show a message asking the user to enable his JavaScript?
Be Humble... Be Nice.
Bear Bibeault wrote:It means you care enough about your users to give them a good experience.
Be Humble... Be Nice.
Ok, I got it. I think I should sleep now Thanks for replying guysBear Bibeault wrote:Read my replies.
Be Humble... Be Nice.
It wasn't my idea to go to some crazy nightclub in the middle of nowhere. I just wanted to stay home and cuddle with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|