Mechanisms for form validation

Asked

Viewed 85 times

7

What are the pros and cons of validating forms with these features:

  • HTML5?

  • Javascript?

  • Jquery?

  • HTML5 + Javascript/Jquery?

There is something to consider beyond these items?

  • 2

    None of these, usually validation is on the server. In the mentioned technologies only the pre-validation is done, to avoid unnecessary communication and waste of time by the user.

  • Regarding server-side validation, is there any specific language? Could you give me some examples?

  • 1

    @Zkk can be PHP, Java, C#, Python or even Javascript (Node.js). It depends on your server. Search here on the site for "validation" and more the name of a language, has enough material.

1 answer

11


HTML5

Practical, but can’t handle all the cases, nor has support in all browsers

Javascript

Quite flexible, but only for those who have JS enabled. Can be swindled by turning off the JS

jQuery

Same as JS, jQuery is just a library to simplify the programmer’s work (and not always good at it)

HTML5 + Javascript/Jquery?

Combines the qualities and defects already mentioned :)

What to do then?

On the client side, the technologies available are HTML and even Javascript, so that’s what you can use. Browser validation serves to provide users with a better experience (for example, without reloading the page, pointing out errors as fields are filled in, etc.). But it does not guarantee that the data posted is valid. For this, the only resource is to validate on the server. Whether to validate in one place, validate only on the server, never only on the client.

Browser other questions tagged

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