XF 2.2 Custom User Field autocomplete

Scandal

Well-known member
Let's say we have a custom user field (single line text box) and an array of possible values ['dog', 'cat', 'elephant'] (haha back to primary school).

How could I make the custom user field to show an autocomplete functionality?
I mean: once I type do, it will show dog that can be selected. If I type el, it wil show elephant and so on.

I thought that it can be via the PHP Callback
Screenshot 2022-10-16 at 09-26-15 Edit field Your College XenForo - Admin control panel.webp
But I can't find any example on the XF folder or other custom addons to take it as base/ example.

Any idea? I need just a small example.
 
@user mentions ?
No user mentions.
I'm talking about custom user fields that can be found on the User Control Panel (example: Account Details page).
This is a single line text box. Once someone typing a text, I want to show some suggestion / autocomplete choices so user can select them. Yes a bit it seems like the mentions system, but in my case is a custom user field. Another important thing: it is not a username autocomplete, it has other suggested values / texts.

I thought that it could be with a php callback but can't find an example.
The Validator radio, as I did some tests, is just for checking the values during the submit, it is not provides suggestions / autocomplete.

Admin control panel.png
 
Back
Top Bottom