I try to check the user login through javascript in the first instance in the browser, and then check on the server the error output in the visualized form (a la rails). Now I use my own set of custom validators, so I can not point you in the right direction using express-form .
Along with my custom regular expressions, I sometimes use the validator package npm, you can also use validator validator in the browser using a simple DOM or some structure.
edit:
working with AJAX checks is quite simple: you get the object in your request (if you use express.bodyParser() middleware), check the parameters if there are some errors that you can point to it in the ex answer.
{ "errors": { "foo": "must be a number" } }
and
for (i in answer.errors) { var target = document.getElementById(i); target.class = "error";
If you use the browser-side framework, there are plugins, or I'm sure it's easy to write.
source share