Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Using answer label on same page

I want to show the label of an answer given to a select question on the same page, it is important that the respondent sees his answer in a specific context.

Is it possible to show answer labels 'live' on the same page?
asked Jul 5, 2018 by Marten
What type of select question?  Radio buttons?
Yes, it's going to be a select question with radio buttons

1 Answer

+2 votes
 
Best answer
Place this where you want the selected text to appear:

<span class="mySelectedText"></span>


Then place this anywhere on the page:

<script>
$(document).ready(function(){
    updateSelectedText();
})

function SSI_CustomGraphicalRadiobox() {
    updateSelectedText();
}

function updateSelectedText() {
    var selectQuestion = 'SelectQ';
    var responseOptions = [% ListLabelsArray(List1) %];
    $('.mySelectedText').text(responseOptions[SSI_GetValue(selectQuestion) - 1]);
}
</script>


"SelectQ" and "List1" must be replaced by the names of the select question and its list, respectively.
answered Jul 5, 2018 by Zachary Platinum Sawtooth Software, Inc. (114,950 points)
selected Jul 5, 2018 by Paul Moon
Live Answer in a Max Diff Exercise
...