Hi,
I have been working with the typical JS code I have found in other threads to pre-select multiple choice options based on embed data:
if("${e://Field}" == "Yes") {this.setChoiceValue(1,true)} // If Yes is your first choice
if("${e://Field}" == "No") {this.setChoiceValue(2,true)} // If No is your second choice
But I am not seeing this occurring in both the published and previewed survey. Not sure what I might be missing here.
Thanks!
Adam
Your field name is missing. It should be something like "${e://Field/YesNo}".
Thanks, Tom. I neglected to include that in my original post, but I am including the field name. Here is a updated version of what I am trying:
if("${e://Field/Field%Name}" == "Yes") {this.setChoiceValue(1,true)}
if("${e://Field/Field%Name}" == "No") {this.setChoiceValue(2,true)}
Any further help would be greatly appreciated!
Your field name still looks suspicious (IMO, creating field names with anything other than letters, numbers, and underscores is bad practice).
Assuming the field name pipe is correct, use the inspect feature of your browser to make sure the choiceid's are really 1 and 2. Depending on how choices have been edited, the ids could have changed.
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.