How to style the HTML5 form validation messages?

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

Was this solution helpful to you?

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

Just Added Q & A:

Find solution

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.