The answer from Superole set me on the path for finding the answer. Unfortunately the Alt+code only works on Windows. So here I will focus on a more general case and then on Linux.
Here Simone explains:
You could consider inserting a non-breaking space into your surname.
- Find a Unicode encoder/decoder online, for example this
- Insert your name as text and convert it to a unicode string. Taking your example "Leonard James Akaar" will be converted into "Leonard%20James%20Akaar"
- Change the last space (Unicode %20) to a non-breaking space (Unicode %A0). The result will look like this "Leonard%20James%A0Akaar"
- Convert it back to text. You will see "Leonard James Akaar" again, but this time the first and the second space are different characters, and the autofiller will recognize "James Akaar" as a single word.
- Copy the text you obtained
- Open settings -> advanced -> passwords and forms -> autofill settings -> edit. Replace your name with the edited one.
However in my case, when I copy the line with the invisible character from the browser my clipboard seems to change it for an space, so when I paste the line on Chrome settings it doesn't change anything. So save yourself some time and paste the result back into the same translator page to verify.
One workaround I found for Linux is:
- Open a console / terminal
- Open a python interpreter
- Inside it, execute this (modify the location of \u00A0 to your needs
# print(u"Name Surname1\u00A0Surname2")
- Copy the result with the mouse > right click
Now that string contains the invisible character. You can use the translator page to verify it.
Finally, you can use these forms to verify if the autofill works as expected
Note: Simon mentioned "%A0" but I needed a code for python. Here I found the translation table.
More descriptive title so others can find it: How to make Chrome browser autofill feature handle correctly two surnames, multiple surnames, multiple names, two names, complex names when filling / autofilling online forms.
use autocomplete attributes
Use any of these for autocomplete:
name(for full name)
given-name(for first name)
additional-name(for middle name)
family-name(for last name)
Example: <input type="text" name="fname" autocomplete="given-name">
This way, you can have the desired info autofilled in the user's form.
Also, here's the recommended guide for all other input fields too.
I finally found a sort of workaround that seems to trick Chrome's splitting algorithm.
In the edit address form (chrome://settings/addresses -> more -> edit) you can replace the spaces that are not "name separators" with the character that you get when you hold downAlt, type 255 on the numeric keypad, and then release the Altbutton.
E.g. for given-name "Kaare Bjarne" and family-name "Van der Kurt" you would get:
Kaare Bjarne Van der Kurt
...and Chrome now seems to autofill it correctly :)
On this page you can test your settings quickly: https://www.roboform.com/filling-test-all-fields