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

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


Forum|alt.badge.img+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});

Best answer by PraDeepKotian_XM

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});

View original

2 replies

PraDeepKotian_XM
QPN Level 5 ●●●●●
Forum|alt.badge.img+21
  • QPN Level 5 ●●●●●
  • 228 replies
  • Answer
  • May 19, 2020

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});


Forum|alt.badge.img+2
  • Author
  • 2 replies
  • May 19, 2020

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


Leave a Reply