Have an idea?

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

Preset one answer for a ranking-style numeric question

Hi,

I'd like to create a ranking question with 10 numeric blanks/answer spaces, but with one of the answers predetermined. My question asks something along the lines of the following:

If (row 1) is worth 100, how much are (rows 2-10) worth?

So I'd like the blank in row 1 to start with "100" already entered in the blank.

Thanks!
asked Apr 10, 2017 by anonymous

1 Answer

+1 vote
You can throw this script into the footer of your ranking question ...
<script>
window.onload=function()
{
 document.mainform.Q1_1.value='100';
}
</script>

This would preset Q1_1 (the 1st item in Q1) to "100".

You can also tweak your script by using the QuestionName function also ...
<script>
window.onload=function()
{
 document.mainform.[%QuestionName()%]_1.value='100';
}
</script>
answered Apr 10, 2017 by Paul Moon Platinum (65,230 points)
I also forgot to mention you can use the value of another question to populate your ranking question ...
<script>
window.onload=function()
{
 document.mainform.[%QuestionName()%]_1.value='[%QA%]';
}
</script>

This example populates your ranking question with the value of "QA".
great answer. thank you!
...