更改帖子形式
我的网站上有简单的登录表单。在给定的要求下,该密码不得发送到服务器,而只能发送 MD5 哈希值。我采用了简单的 MD5 函数,现在,当使用 onClick 提交按钮时,我将隐藏文本从密码更改为 md5(密码)。这工作正常,但用户看到,他的密码正在发生一些事情。我想让它透明并通过 onPost (或类似的东西)回调动态更改表单的这个特定部分。
我找不到任何教程如何处理在 javascript (jquery?) 中操作 POST 表/表单,所以如果有人可以提供帮助,我将不胜感激。
I have simple login form in my website. In given requirements stands, that password mustn't been sent to server, but only MD5 hash. I took simple MD5 function and now, when with onClick on submit button I change hidden text from password to md5(password). This works fine, but user sees, that something with his password is happening. I would like to make it transparent and change this particular part of form dynamically with onPost (or smth like this) callback.
I can't find any tutorials how to deal with manipulating POST table/form in javascript (jquery?) so if anyone could help I would appreciate.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,没有
name
的输入字段不会提交到服务器。因此,您可以有一个隐藏字段,并在表单的 onsubmit 事件中通过应用 MD5 校验和将密码字段的值复制到隐藏字段中:然后:
As far as I know input fields that don't have
name
don't get submitted to the server. So you could have a hidden field and in the onsubmit event of the form copy the value of the password field into the hidden field by applying the MD5 checksum:and then: