用户可以复制隐藏字段数据吗?
我有一个包含许多隐藏字段的表单。当用户从表单中选择文本并将其粘贴到文本编辑器中时,他们可以看到隐藏字段的值。这不会发生在每个人身上。然而,对于遇到这种情况的用户来说,他们在所有浏览器上都会遇到这种情况。我无法复制这个。有关可能出现问题的任何线索吗?
干杯,
I have a form with many hidden fields. When a user selects text from the form and pastes it in to a text editor - they can see the values of the hidden fields. This doesn't happen to everyone. However, for the users that are experiencing this, they experience it across all browsers. I haven't been able to replicate this. Any clues as to what might be the problem?
Cheers,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你是如何隐藏字段的?如果您使用 CSS
visibilty:hidden
,那么这些字段仍会占用渲染页面上的空间,并且可能可选择也可能不可选择。要使用 CSS 隐藏字段,请使用display:none
,这应该会阻止浏览器在页面上分配渲染空间。请记住,无论它们如何隐藏,“查看源代码”都会显示它们,因此不要将安全敏感数据放入其中。
How did you hide the fields? If you used CSS
visibilty:hidden
then the fields still take up space on the rendered page and may or may not be selectable. To hide fields with CSS usedisplay:none
which should prevent the browser from allocating rendered space on the page.Remember that no matter how they're hidden, "view source" will reveal them, so don't put security-sensitive data in them.