Should I use HTML5 for client-side form validation?
-
I am trying out HTML5 form validation for a project, but I am not convinced by the lack of control over the feedback messages* without javascript. At its present state, is it recommendable to use browser validation as part of your scripting or does this feature need to mature more before becoming standard? * (the error-bubbles, their look, their localization, their content)
-
Answer:
Yes, validate at all layers of your application; starting with built-in form validation and ending with server-side validation. See 's answer to for an explanation of why this is good practice. Let HTML5 provide immediate feedback to the user. You may use JavaScript as a fall-back if the user's browser doesn't support HTML5 form validation. In any case you should use JS to perform a sanity check on the data before submitting the form. When the server-side script receives the data, check it again to ensure it is well-formed.
Rick Viscomi at Quora Visit the source
Other answers
I think there are a few questions you can ask yourself: What browsers are the users using? Are there a lot of users with browsers not supporting HTML5? How will they be affected? What types of validation need to be done? Is it simple formatting, like alphanumeric, emails etc? Is the back-end required, such as checking whether an user ID already exists? What are the potential impacts of receiving unverified data?
Tran Dac Anh
Related Q & A:
- What risks do I have to consider when encrypting server side as opposed to client-side?Best solution by Information Security
- Can I get OSQL if I install SQL Server Client Tools?Best solution by Database Administrators
- How does the form validation work on angularjs with ionic?Best solution by blog.nraboy.com
- How can I get the remote server's date and time at the client side in my application in c#?Best solution by Stack Overflow
- What form would I use to record my volunteering?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.