Thank you in advance to anyone who can help!
I'm assisting on round 2 of a project and we're trying to re-use a bit of JS code written in 2019 by someone who is no longer working on the project.
The question type is form-field, and respondents can enter up to 20 responses. We'd like to ensure that when respondents start typing, an option from a list of 800+ options starts to auto-complete - we want to reduce the amount of data clean up to do later on.
Our code looks like:
Qualtrics.SurveyEngine.addOnReady(function()
{
var autocomplete_services = [
"Example Option",
"Example Option 2",
]
jQuery(# + this.questionId)
.find(".InputText")
.autocomplete({source:autocomplete_services})
});
When I try to apply this as javascript to the question (with our actual options between the [ ] brackets), I get an "Invalid Javascript! You cannot save until you fix all errors: Unexpected token ILLEGAL" message!
As mentioned we're trying to re-use this bit of code that was previously written, and I'm not familiar enough with JavaScript to figure out what's going wrong on my own. I feel like there's something really obvious I'm missing.
Any help is greatly appreciated; I couldn't find any similar questions by searching. Thank you in advance!
Resolving "unexpected token ILLEGAL" message in an autocomplete form-field question?
Best answer by ahmedA
change # to "#"
Sign up
Already have an account? Login
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login to the Community
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
