1

I know it is quite simple with Conditionals to show and hide fields based on another fields value in a Webform -- is it possible to change values of fields based on another field's value?

For example, if someone selected a certain membership type in a field at the top, could a field lower down automatically have certain selections disabled automatically (or a single selection selected, and the entire second field disabled)?

This is a bit of an oversimplified example, but:

Membership type (select) > Single person

How many t-shirts would you like (select)? [Preselect "One" and disable the field from edits]

and

Membership type (select) > Two people

How many t-shirts would you like (select)? [Option to select "One" or "Two"]

1

You could use normal conditional fields for that. Simply create two "How many t-shirts" fields, one with only one enabled option, second with both available. Then, make them visible depending on value in "Membership type". It is possible since Webform version 7.x-4.0-alpha2, and earlier using this module.

Sure, this will create two separate entries in results, and only one filled, but if your traffic is low, it will be easy to read. And if it's high, you can aggregate easily in your warehouse handling software. Or in spreadsheet of your choice, after export.

  • Thank you -- I may end up doing something like this if I can't figure out a more elegant way to do it. I appreciate the idea! – Laryn - CEDC.org Aug 19 '15 at 1:46
  • @Laryn I admit it's not elegant. But it's the only thing I could answer fast :) I'll gladly upvote alternatives. – Mołot Aug 19 '15 at 5:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.