且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何忽略来自浏览器的jquery验证验证。

更新时间:2023-12-03 14:59:16

用户可以关闭Javascript。或者他们可以使用本地计算机上的HTML文件向您的服务器提交数据,您的Javascript将无法执行。



您执行的任何验证客户端也必须始终在服务器上执行。
The user can turn off Javascript. Or they can submit data to your server using an HTML file on their local computer, where your Javascript won't get a chance to execute.

Any validation you perform on the client must always be performed on the server as well.


选择。禁用javascript,删除javascript,以编程方式提交自己的表单(垃圾邮件发送者可能会这样做),通过输入仅包含空格的字段来利用javascript中的弱点。



Javascript验证很不错,但服务器端验证是强制性的。
Take your pick. Disabled javascript, remove the javascript, submit their own form programatically (spammers are likely to be doing this), exploit weaknesses in the javascript by entering fields with only spaces.

Javascript validation is nice to have, but server-side validation is mandatory.