Remember Me auto fill value in forms

1.2k views Asked by At

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

There are 1 answers

1
Guruprasad J Rao On

In your form you can use autocomplete=false as below:

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

.... other codes

</form>

If you want it to specific controls then add this property only to them like password:

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

Browser Support:

  • Chrome >= 17.0
  • IE. >= 5.0
  • Firefox >= 4.0
  • safari >= 5.2
  • Opera >= 9.6

Visit here to know more about autocomplete

When AutoComplete is not supported, you can use some workaround like this:

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