Client side Javascript versus Server Side Python
If I want to create a registration form, what are the pros and cons of validating – checking – for incorrect input- through each method. What do you recommend?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
JavaScript
– Pros:
Easy to test and implement. When doing form validation JavaScript can do instantaneous validation and has many utilities for regex checking and DOM traversal (jQuery). Also, the processing is offloaded to the client (though this may be negligible).
– Cons:
Users that don’t support JavaScript
Python
– Pros:
Support for users without JavaScript. Hidden and therefore more secure.
– Cons:
The page will need to be refreshed in order for results to be displayed. This may be frustrating for some users as not all fields (eg password field) should be saved.
I would use JavaScript for instantaneous feedback and Python for end-result error-checking and as a fallback for users without JavaScript.