1Password apparently follows an ‘HTML spec standard’. Looks like it came from a collaboration from …Copyright © WHATWG (Apple, Google, Mozilla, Microsoft)…
My web application uses a multi-tab screen with email text fields (username) on different tabs for different purposes. Because of that design I have to name the fields different names.
I actually like that because of the side benefits for tracking different parts of my code.
1Password requires ‘username’ as the field name for autocompletion or apparently it will also work with an attribute.
In a support email, they have told me
… So using the
autocomplete="NameOfAttributeHere" is what will allow you to tell password managers (and 1Password in particular) what this field should be autofilled with…
You might find these links helpful:
So my question is this:
Is there a way for me to add an attribute such as
to a text box, so that 1Password can pick up the correct fill-in information?
In the Shown event of your WebTextField:
Did you inspect the other fields to see if the attribute is applied? Could be an issue with the 1password extension.
Is possible to do the same with desktop App ? and how if someone have the solution
I am getting some unexplained action right now. It was working yesterday, and now after my tests for the other tabs, it is not working as I expected. I may put together a simple desktop version with just the tab panel that does nothing but contain fields and test that. I’ll post my results.
OK, I’m not sure why this has the effect it does, but I set the field type to Email and AllowAutoComplete to True and it retains the autocomplate attribute value that the line of code I supplied before sets.
Sub Shown() Handles Shown
me.FieldType = WebTextField.FieldTypes.Email
me.AllowAutoComplete = True
Well now - that works as expected across ALL tabs! It also fixed an issue I had with the CC number in a text field. It was showing only the first and last four digits, with autocomplete turned on, it now shows all the digits and fills in as expected. Thanks Anthony for your help! And I learned how to see how it renders inside of html using the inspect feature.
Just glad I was able to help you sort this out! A word of warning, though. I didn’t expect this second bit to work, so I’d be wary of changes in future versions of Xojo breaking it. If that happens, we’ll do something a bit different like attach a MutationObserver (we could do that now, but support isn’t quite universal yet).
There are few other quirks as well, so yes a close eye I think will be helpful.
On one of the tabs I have vertically spaced three fields.
If I change the passwordFieldConfirm (the third field) from a password to a textbox the first field (textFieldNewEmail) does not auto complete correctly anymore.
The HTML rendered though does appear to be correct.
I have already filed a bug report with two passwords on top of each other not behaving correctly. That’s probably related.