3
Views
2
Comments
Setting a Default Value on Autocomplete textbox field
Question
Hi ,

When we load a webpage with an autocomplete textbox on it, i want a default value set on it.

On the example attached, i was able to replicate this behavior, but when we click on save, no value is set.

 Set a default value on an autocomplete textbox, is possible?


default_value.oml
2017-10-02 14-22-21
Paulo Tavares
Staff
Hi João.

Sorry for the late reply.

I indeed went through your code and it made perfect sense - probably that would be a bug, and I encourage you to submit it to our support channel.

Regarding how to do what you want, the workaround I managed to do was, in the "Save" action, use an if statement saying (in pseudo-code):

if ( var=AutocompleteSuggestionList2.Current.Input_Autocomplete_ListEntry.Label )

then

id = IntegerToEntityRefInteger(TextToInteger(AutocompleteSuggestionList2.Current.Input_Autocomplete_ListEntry.Identifier))

else

do the normal thing.

I hope that does the trick for you.

Best regards,

Paulo Tavares

2024-11-04 15-59-50
João Inácio

Thanks a lot Paulo, this workaround is perfect.
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.