javascript - 什么时候需要服务器端验证?

标签 javascript jquery forms validation server-side-validation

我正在使用 jquery 提交表单,就像用户单击提交图像一样,它将提交表单。因此,在这种情况下,如果用户在浏览器上禁用 java 脚本,用户将无法提交表单。

那么我需要对此表单进行服务器端验证吗?因为我知道,当有人在浏览器上禁用 javascript 时,服务器端验证会很有帮助,但在我的情况下,用户在禁用 javascript 后无法提交表单,所以为什么我需要服务器端验证。

如果我错了,在什么情况下我需要服务器端验证?

最佳答案

Because your client side validation may be subverted.

For example - on the web, if you are using javascript for validation, it is very easy to either turn javascript off, or change how it works using tools such as FireBug.

Event with other client/server methods, it is possible for the data link to be subverted and the "validated" data can be changed on the way to the server (Man In The Middle attack).

In general, the maxim "never trust the client" is the reason that you need to always validate on the server.

You may ask in that case, why validate on the client? In order to provide immediate feedback.

Why do we need server side as well as client side validation for Web applications?

检查这个

关于javascript - 什么时候需要服务器端验证?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19699570/

相关文章:

javascript - 如何对存储在一个文本字段中的各种值求和?

javascript - 无法获取html中div的高度

javascript - 使用 Jquery 获取字符串的正则表达式模式

c# - 将工具提示添加到组框

javascript - 对我的 JavaScript 进行基准测试的最佳工具是什么?

javascript - 隐藏/显示 div,如何在脚本中更改标签

javascript - 多重解析初始化

javascript - 使用 jquery 在页面上查找具有特定文件名的图像

javascript - 单选按钮选择验证

api - Craigslist API - 如何发布 RSS 数据?