Hi,

I often see surveys with this kind of questions :

What's your favorite cake

- Cookie
- Brownie
- Other (clarify) [ textfield here ]

It is possible to reproduce this kind of questions with the free choice textfield if no answer fill the user need ?

thanks

zmove

Comments

quicksketch’s picture

No, not directly within Webform. It is actually possible, though it'd take some crafty form-building to get it to work. You can theme the form using the instructions from THEMING.txt or just put <script> tags inline in the Webform description. Add some JavaScript to show the textfield if "other" option is selected.

<script>
$('input[@value=other]').change(function () { $('#edit-submitted-other').slideToggle(); });
</script>

Note that this is totally nonfunctional code, but it sets you off in the right direction. See http://visualjquery.com to learn some jQuery.

zmove’s picture

Ok thank you,

As I create this survey on a production site, I will not play with the Devil so I created another "component" type textfield for user that check "other" for the previous question, it works pretty well.

The only problem is that I cant make this field required because people that will not check the "other" checkbox in the previous and so, people that check "other" are not obliged to fill the textfield too, but it's a pretty minor problem.

quicksketch’s picture

Category: support » feature

I'm moving this to a feature request, because it's common enough and (in my opinion) a strong point that SurveyMonkey has over Webform. I'd like to get it implemented eventually.

amanda’s picture

I think this is basically a duplicate of: http://drupal.org/node/254728

quicksketch’s picture

And if it's not a duplicate of that one, it definitely is a duplicate of this one #330740: "Other" option in select lists for text entry. Let's followup there regarding select lists specifically. The #254728: Conditional fields issue is a bit more complex as I think it gets into all kinds of conditional logic. This request is a bit simpler.

quicksketch’s picture

Status: Active » Closed (duplicate)
zbombicz’s picture

subscribing