Forms Validation Mechanisms

7

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

  • HTML5?

  • Javascript?

  • JQuery?

  • HTML5 + Javascript / JQuery?

Is there anything else to consider besides these items?

    
asked by anonymous 03.02.2016 / 16:09

1 answer

11
  

HTML5

Practical but does not take care of all cases, nor supported in all browsers

  

JavaScript

Pretty flexible, but only for those who have JS enabled. Can be circumvented by turning off JS

  

jQuery

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

  

HTML5 + Javascript / JQuery?

Combine 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 the fields are filled, etc.). But it does not guarantee that the posted data will be valid. For this, the only resource is validate on the server. If you're going to validate in one place, just validate on the server, never just the client.

    
03.02.2016 / 16:17