Can you autopopulate text in Multiple Choice "Allow Text entry"? | XM Community
Solved

Can you autopopulate text in Multiple Choice "Allow Text entry"?


Badge +2

I can enable autocomplete on free text questions with the script below, but it doesn't work on multiple choice where I enable text entry for an option.
This would be the question, I would like to have the text entry populate the available building IDs.
Question:
" Q: Please provide your location

  • Type your building ID (Text Entry enabled for this option)

  • I would rather not answer "


This is the script that works for free text questions:
{
var textOptions = [
"Text Option 1","Text Option 2","Text Option 3"
];
jQuery('.QR-' +this.questionId).autocomplete({source:textOptions});

icon

Best answer by PraDeepKotian_Ugam 19 May 2020, 07:04

View original

2 replies

Userlevel 6
Badge +21

Hi Josue

I have used below code and it worked.
var textOptions = ["Text Option 1","Text Option 2","Text Option 3"];
jQuery("input[type=text]").autocomplete({source:textOptions});

Badge +2

Thank you PraDeepKotian_Ugam ! That one did the trick. Appreciate the help.

Leave a Reply