Modifying the option label in Select
I would like to modify the option's label in the select box.
My working code without any added text looks like this:
And this works and the user names are shown based on what you type in the select box.
I would like to add a custom text (I will replace it later with a custom generated quote like "I only trust my sword" etc.)
at the end of the name.
So, instead of what I have now:
I would want:
In the results in the select box as the user is typing stuff in it.
How to alter the option output to reflect the added text?
Let's say the labels are stored in the table called
Or just with a custom static text or html like
I have tried suggestions my some Discord users like:
But this is not working and the output is still just the name. The part " - my custom text" is missing.
My working code without any added text looks like this:
And this works and the user names are shown based on what you type in the select box.
I would like to add a custom text (I will replace it later with a custom generated quote like "I only trust my sword" etc.)
at the end of the name.
So, instead of what I have now:
I would want:
In the results in the select box as the user is typing stuff in it.
How to alter the option output to reflect the added text?
Let's say the labels are stored in the table called
quotes and they have an id and quote for the quote itself. And it should be random.Or just with a custom static text or html like
- my custom quote or <b style='color: green;'> - my custom quote</b>I have tried suggestions my some Discord users like:
But this is not working and the output is still just the name. The part " - my custom text" is missing.