mercredi 25 octobre 2017

Form validation on client then server

I'm designing a web application with vue.js and REST Services (java).

I have a very complex form: - type checks : email is a well formatted email - password checks : password textfield and retype password textfield matches? - 2 dropdowns: if I select option A in dropdown 1, in dropdown 2, option {R,T} should appear only.

So, a simple way to deal with this would be: 1. perfect proper checks on client with javascript or some vue plugin. 2. Recheck all on server to make sure nobody "hacked" the json submitted.

The main issue is that I will code twice the checks.

What could be a better approach?

Best regards




Aucun commentaire:

Enregistrer un commentaire