简体   繁体   English

登录证书将反映在注册表格中

[英]Login credentails get reflected in Registration Form

I am working on Spring MVC project. 我正在从事Spring MVC项目。 At the time of login i have saved login credentials( User Id and Password ) in the browser(Chrome). 登录时,我已在浏览器(Chrome)中保存了登录凭据( 用户ID和密码 )。 In this application there is Member Registration Form. 在此申请中有会员注册表。 When i am login to application and go to Register new member, login credentials get automatically reflected in User Id and Password Fields. 当我登录到应用程序并转到“注册新成员”时,登录凭据将自动反映在“ 用户ID”和“密码”字段中。

在此处输入图片说明

I have try with different way to get User Id and Password fields blank at the time of get registration form. 我尝试用其他方法在获取注册表格时将用户ID和密码字段留空。

1) Set autocomplete="off" at form level and field level. 1)在表单级别和字段级别设置autocomplete="off"

2) Set User Id and Password fields blank using JQuery. 2)使用JQuery将用户ID和密码字段设置为空白。

3) Set User Id and Password attributes blank in model attribute object on controller. 3)在控制器的模型属性对象中将用户ID和密码属性设置为空白。

Is there any way to solve this problem. 有什么办法可以解决这个问题。

Try to use the following Javascript code, that initialize the username and password values when the page is loaded: 尝试使用以下Javascript代码,该Java代码在页面加载时初始化用户名和密码值:

function resetValues() {
   document.getElementById("username").value = "";
   document.getElementById("password").value = "";
}
window.addEventListener("load", resetValues);

This is a DEMO . 这是一个DEMO

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM