Have an idea?

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

Radio button empty textfield when selected

Hey guys,

I want to set up a free format question like this:

 Have you ever been to X town?

O No
O Yes,  | __________| times

The respondent should either say "no" or "yes" and then how many times he has been there.

I got one variable Q1_a which is a radio button and one variable Q1_times which is a numeric text field. "No" has the value Q1_a=1 and "Yes" has the value Q1_a=2

My problem: when "No" (Q1_a=1) is selected I want the text field (Q1_times) to be emptied.
Other way round: when I enter something into the text field (Q1_times) I want "yes" to be selected automatically (Q1_a should be 2).

So I'm kindly asking for a little Javascript help from you guys.
Thank you in advance
asked Apr 24, 2014 by lieferant (320 points)
retagged Apr 24, 2014 by Walter Williams

1 Answer

+1 vote
You don't need a free format, a simple select question works.
Make the "yes" an "other, specify."
When they type in a value, "yes" is automatically selected.
Just set the "other, specify" to be numeric with the value range that applies.
If they click, "no" the number of times is blank.
answered Apr 24, 2014 by anonymous