Remember Me auto fill value in forms

时间:2015-06-22 11:06:40

标签: html5 cookies grails-2.0 shiro j-security-check

I am working with Grails Framework. I am using Apache Shiro Security for authenticate and authorization. In My application following is my login page.

enter image description here

Now when I checked with Remember Me my "username" and "password" manage by Shiro security but after successfully login I have one more form which contains following information:

enter image description here

Now my new form automatically filled by remember me values so how to prevent remember me values to another form in my application?

1 个答案:

答案 0 :(得分:0)

在表单中,您可以使用autocomplete=false,如下所示:

<form id="someForm" autocomplete="false">

.... other codes

</form>

如果您想要特定控件,请仅将此属性添加到password

<input type="password" autocomplete="false"/>

浏览器支持:

  
      
  • Chrome&gt; = 17.0
  •   
  • IE。 &gt; = 5.0
  •   
  • Firefox&gt; = 4.0
  •   
  • safari&gt; = 5.2
  •   
  • Opera&gt; = 9.6
  •   

访问此处以了解有关 autocomplete

的更多信息

如果不支持自动完成功能,您可以使用以下解决方法:

<input type="password" readonly onfocus="this.removeAttribute('readonly');"/>