NetTalk Central

Author Topic: Autofill off request  (Read 6541 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Autofill off request
« on: May 17, 2020, 04:33:20 AM »
From https://cloudfour.com/thinks/autofill-what-web-devs-should-know-but-dont/

When a form is submitted, Microsoft Edge and Firefox will store the value submitted along with the value of the name attribute. If the browser sees a field in the future with a matching name attribute, it will provide autofill options. Firefox also appears to look at the id in addition to the name attribute

In a User Register Form I need to turn off that browser feature.

Because there are security and privacy concerns with this approach, the autocomplete off value has long been supported to prevent the browser from storing and autofilling sensitive information.

How to do it in NT?
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Autofill off request
« Reply #1 on: May 17, 2020, 09:11:12 PM »
If you look at the generated HTML in your browser devtools, I think you'll see that autocomplete="off" is already there....

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Autofill off request
« Reply #2 on: May 18, 2020, 03:46:20 AM »
Ok, then this does not work.
Chrome autofills NT fields with autocomplete=off

May be this could help:?

Officially it should be: autocomplete="off". However many browsers bizarrely ignore this.

Therefore it's best to just put some random string on the autocomplete section like:

autocomplete="autocomplete_off_hack_xfr4!k"
That's why autcomplete="false" accidentally works.

Note that make sure the autocomplete value for each input is different. Hence the random string at the end. Or else you may get suggestions from fields with the same autocomplete value.

Also comebody says you should set and invalid value for it to work like:
autocomplete="nope"

« Last Edit: May 18, 2020, 03:53:21 AM by michelis »
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Autofill off request
« Reply #3 on: May 19, 2020, 12:14:05 AM »
thanks for the info Alberto - I'll update for the next build...

cheers
Bruce

Matthew51

  • Full Member
  • ***
  • Posts: 152
    • View Profile
    • Email
Re: Autofill off request
« Reply #4 on: May 20, 2020, 01:11:32 PM »
Can we get autocomplete changed to a string? I've been using loc:extra to get around that. ie:
Code: [Select]
loc:extra = 'autocomplete="new-password"'
Contractor with 10+ years of NetTalk experience looking for work.
www.linkedin.com/in/matthew-leavitt
BisWare.ca
Check out my free EasyTime Template

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Autofill off request
« Reply #5 on: May 20, 2020, 09:47:04 PM »
you're wanting to set the auto-complete to a specific value for a specific field?

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Autofill off request
« Reply #6 on: May 21, 2020, 01:56:50 AM »
I personally think its enough to set it on the form for all fields.
-----------
Regards
Alberto

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Autofill off request
« Reply #7 on: May 21, 2020, 02:39:41 AM »
More about it.
I open a form to fill an address, in this case I want autofill to work.
I began typing th address and the browser suggest the correct one, I select it and the browser fills Address, street, city, country.
This is OK.
Now I need to calculate the lat lon of that address and ... its not available as session values.
Then I need to save the form, open it again and then it works
Any way of replicate what the save button does in my "Get lan lon" form button?
-----------
Regards
Alberto

Matthew51

  • Full Member
  • ***
  • Posts: 152
    • View Profile
    • Email
Re: Autofill off request
« Reply #8 on: May 21, 2020, 01:10:39 PM »
you're wanting to set the auto-complete to a specific value for a specific field?

Yes, their's too many possible values to do it any other way.
Contractor with 10+ years of NetTalk experience looking for work.
www.linkedin.com/in/matthew-leavitt
BisWare.ca
Check out my free EasyTime Template

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Autofill off request
« Reply #9 on: May 23, 2020, 12:33:29 AM »
>> Yes, there's too many possible values to do it any other way.

I've added a template setting so you can set the attribute to whatever you like for each field in 11.37.

cheers
Bruce