Have an idea?

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

Question on Free

Thanks Zachary...

Do I have to replace the [% QuestionName() %]_order"

With the name of the Free format question? When I added this as a hidden text it shows Free_order in the box?

asked Jun 4, 2018 by anonymous

1 Answer

0 votes
You do not have to make any replacements besides the ones specified in my post.

The Sawtooth Script function QuestionName prints out the name of the question where the function appears.  So when the server sends the survey page to the respondent, it automatically converts this:

<input name="[% QuestionName() %]_order" id="[% QuestionName() %]_order" type="hidden" value=""/>

to this:

<input name="Free_order" id="Free_order" type="hidden" value=""/>

I just use the QuestionName function instead of the actual question name so renaming the question won't require updating the custom code.
answered Jun 4, 2018 by Zachary Platinum Sawtooth Software, Inc. (206,075 points)
And yes, the software will often print out the variable's "full name" - the free format question's name, followed by an underscore, followed by the variable's name.