Setting Auto Compelete off to Liferay AUI Forms

Hi Liferay developers,

We all use AUI components extensively during our Liferay portal development, Right? While using AUI forms we may need to set autocomplete settings on our forms based on the sensitivity of the data our forms carries, like login form, credit card information forms etc.

Now AUI form don't provide scope to set autocompelete, have a look here to all AUI form attributes.

This also logged as known bug in AUI form and still in open state by the time this blog is written.

Don't get disappointed, although autocompelete attribute is not available in AUI form we can still get it by just adding autocompelete attribute to AUI form as below, and it's done.

<aui:form 
     action="SOME_FORM_ACTION" method="POST" 
     autocomplete="off">

// Form fields will go here

</aui:form>

Cheers!!!

Comments