In the past I have used various autocomplete solutions and I was always able to either “force selection” or just let the user type what ever they wanted. I need this functionality because the autocomplete searches a contacts table but they also need the option to simply enter in the name without having to add them to the contacts table. (don’t ask why haha)
I notice with the autocomplete if you don’t make a selection and tab or click out of the input, it clears the input.
I thought that a workaround would be to hide a text input and then toggle the visibility of the text and autocomplete fields based on a click. That said, it doesn’t appear that the “show” option for an input appears as a choice for dynamic click action.
ALMOST WORKING: Then I thought maybe I would set a variable default value to “autocomplete” and then set dynamic “hide” on the autocomplete input to what’s below:
var_agreed_to_by_toggle.value != ‘autocomplete’
and the dynamic “hide” on the text field to what’s below:
var_agreed_to_by_toggle.value == ‘autocomplete’
when the button is clicked the variable is changed based on what’s below:
var_agreed_to_by_toggle.value == ‘autocomplete’ ? ‘text’ : ‘autocomplete’
The text input toggles to hide and show correctly but the autocomplete field is always visible and I can’t see what I’m missing. Been a long day so no telling haha.
Thanks in advance
Last updated: