0

I read here that the main reason for using client side validation is:

the user can correct every field before they submit the form

This (sort of) assumes Ajax, but if the client side validation consists purely of Javascript, is there really a point to it anymore? It's easy enough to point out specific mistakes and store form data on refresh from PHP / Django / node.js, so if the client side script isn't pointing out mistakes as the user is making them, does it really make sense both from a UI and developer perspective to take the time to write that bit of code?

Vector
  • 62
  • 1
  • 11
  • 1
    Pointing out mistakes on the client side as they occur can be very helpful to the user regardless of Ajax. If you feel the time investment isn’t worth it, that’s fine. Keep in mind that a lot of checks don’t need JavaScript anymore with HTML5 input types (`email`) and validation (`required`, `pattern`, and `title` attributes). – Ry- Feb 11 '18 at 00:34

1 Answers1

2

Client side validation helps you prevent errors from entering into your server/database and adds a second layer of protection.

As far as Ajax is concerned, you will be sending your data from the client to the server one way or another so if you're using Ajax or not is irrelevant.

From a developer's perspective, even something as simple as checking all the fields for valid data types on form submit is worth the effort. This saves your server from having to process an invalid entry and shifts that load to the user's system. For large scale applications this dramatically increases performance.

From a UI perspective, I understand that incorporating error checking into the form makes it a little bit difficult, but in my opinion this is a minor inconvenience to save you much more hassle of having to clean your database in the long run.

Edit: As Ryan pointed out in his comment to the question, users definitely appreciate feedback without having to wait for it

Mak
  • 894
  • 2
  • 8
  • 24
  • Performance is hardly a serious consideration. Issue is really more about user experience – charlietfl Feb 11 '18 at 00:45
  • Thanks, I guess I wasn't reading the linked answer the way it was intended. This puts things into context! – Vector Feb 11 '18 at 00:46
  • @Vector , if you're happy with this answer then could you please mark this as the answer and close the thread? – Mak Feb 11 '18 at 04:15
  • Yup, I was waiting to see if anyone else was going to answer, but now I will – Vector Feb 11 '18 at 23:45