如何验证和处理Express(NodeJS)中的表单 [英] How to validate and handle a form in Express (NodeJS)

查看:115
本文介绍了如何验证和处理Express(NodeJS)中的表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我真的在寻找类似Django表单中的抽象级别 - 即验证以及模板中的错误报告。



如果客户端可以使用相同的验证,那将是非常好的。


$ b $有没有人使用过或写过任何东西?

解决方案

看起来这个位于< a href =https://github.com/caolan/forms =noreferrer> https://github.com/caolan/forms 。我从来没有使用过,但它似乎相当全面。


Is there a preferred form handling and validation library for Express?

I'm really looking for a similar level of abstraction as is found in Django forms - i.e. validation and error reporting in the template.

If the same validation could be used on the client side, that would be great.

Has anyone used, or written, anything good?

解决方案

It looks like there's a module for this located at https://github.com/caolan/forms. I've never used it, but it seems fairly full featured.

这篇关于如何验证和处理Express(NodeJS)中的表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆