Can I only use HTML5 Form Validation for Client-side validations?

Asked

Viewed 64 times

2

I’m a little worried about using HTML5 Form Validation because despite the simplicity of implementation for some browsers, mainly Ios and Safari support is partial as seen here.

In my current project (which I am implementing Form Validation) the need is that all forms have to be validated correctly in all major browsers of the market, and the simplicity of implementation (which does not require any javascript) I would like to be able to implement only HTML5 Form Validation for Client-side validations. The question is: should I? considering that some browsers provide only partial support (what does this mean exactly?), my fear is that in any of these browsers the mandatory completion is not required due to lack of browser support.

Note: the doubt is not a question of security, but of support in the main browsers, considering a scenario where only the HTML5 Form Validation is implemented, without another type of validation through javascript.

Note 2: consider only browsers in their most current versions.

2 answers

1


No, HTML5 validations are not mature enough to walk alone, and wherever possible ensure maximum consistency in your data by also validating in Javascript.

If you understand that the HTML5 form validation scenario is partial, ask yourself about:

Consistency can be ensured in the data received?

In experience HTML5 validations are not enough, even more if you want to ensure the same behavior of validations, that is, the same way that messages are shown.

Note 2: consider only browsers in their most current versions.

The interesting thing is to work anywhere, imagine how sad it would be to show your site to a friend and not open why it is not in the appropriate version.

0

Must use?

Yes, is a great and fast way to validate a form, since the user can immediately know if he entered a wrong data. This saves waiting time for an HTTP response, and saves your server from dealing with a bad form entry. But validation via JS is also indispensable. And for more "sensitive" information, a new validation in the controller.

  • But whereas some browsers only offer partial support for the HTML5 Validation Form as seen in the link presented?

  • @Rafaelalexandre That is why validation by Javascript is indispensable. You should always have in addition to Form Validation, a validation by javascript before sending the data to the server.

  • So I can’t be sure only in the HTML5 Validation Form for Client-side validations.

  • @Rafaelalexandre No, because the user can manipulate html. In a practical example, where the input is assigned with "required". If removed by specifying element, the field is free to send no data to the server.

  • Yes, but my question is not exactly about security, but about support. I’m wondering if there are browsers, like Safari Ios that offers partial support, where the implementation will no longer work.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.