1. Queenielass
  2. Support
  3. Thursday, April 26 2018, 08:15 PM
Can you advise me as to the best way to turn off {browser} autocomplete details on the Registration form, please?
I have tried to adapt the mod_login as an override by adding autocomplete="off" eg

<input id="modlgn-username" autocomplete="off" type="text" name="username" class="input-small" tabindex="0" size="18" placeholder="<?php echo JText::_('MOD_LOGIN_VALUE_USERNAME'); ?>" />


but I am not sure if that is correct and I have no idea where the best place is to do this for the registration form.
References
  1. https://getmentorednow.com
admin Accepted Answer
Admin
Hi,
you should use autocomplete="off" in all fields (required by Chrome and Webkit based browsers) and in the form (required by Firefox and Gecko based browsers) html tags. The fastest*** way to make this is to add the autocomplete attribute via Javascript with a code like this:
jQuery(document).ready(function(){
jQuery('#member-registration, #member-registration input').attr('autocomplete','off');
});


*** there are many ways to make this and normally is recommended a template override (like your login module), but Registration form is dynamic and this is not possible with a simple way, so I suggested you the javascript solution.
  1. more than a month ago
  2. Support
  3. # 1
Queenielass Accepted Answer
Pro
Content Protected
  1. more than a month ago
  2. Support
  3. # 2
admin Accepted Answer
Admin
Hi,
I created a custom js file in my_Template > Custom> JS > autocomplete-off.js - is this the correct way to do it?
It seems ok, because it is loaded in your site.

Also, I read that Chrome no longer supports autocomplete="off" and it's recommended to change instead to 'autocomplete="new-password"'
I'm sorry but I does not know this :o
Anyway my code add also autocomplete="off" in form declaration and it should be necessary to work with firefox like browsers.

This hasn't worked as yet - I have scripted this correctly?
You code is not correct. This code:
attr('autocomplete="new-password"');
should be
attr('autocomplete','new-password');
.
The correct should be something like:
jQuery(document).ready(function(){
jQuery('#member-registration').attr('autocomplete','off'); // Firefox browser, autocomplete in form declaration
jQuery('#member-registration input').attr('autocomplete','new-password'); // Other browsers, autocomplete in the fields
});
  1. more than a month ago
  2. Support
  3. # 3
zenpig Accepted Answer
Content Protected
  1. more than a month ago
  2. Support
  3. # 4
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.