NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Alberto 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?
-
If you look at the generated HTML in your browser devtools, I think you'll see that autocomplete="off" is already there....
-
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"
-
thanks for the info Alberto - I'll update for the next build...
cheers
Bruce
-
Can we get autocomplete changed to a string? I've been using loc:extra to get around that. ie:
loc:extra = 'autocomplete="new-password"'
-
you're wanting to set the auto-complete to a specific value for a specific field?
-
I personally think its enough to set it on the form for all fields.
-
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?
-
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.
-
>> 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