Score:2

custom handler for webform?

om flag

I'm not sure how to go about this... Given a simple registration form that has three fields

  • email
  • country
  • optIn (conditional)

When this form is presented, I'd like the Opt-in field to be hidden unless a specific country is specified.

Easy, so far. Just specify a condition for the Opt-in field set to country being a specific value.

Here is the catch:

Instead of the country being a static single (or multiple hardcoded values), I'd like to check against a list of countries already defined (in config).

Seems I will need to write a custom handler/plugin of this, but not sure which one to use as a base, or - if that is even the right approach. Obviously, I'd like to retain the ajax behavior of the opt-in field appear / not appear dynamically when the address field is filled in (e.g., I don't want to have to wait for a form submit) In the example below, I've arbitrarily configured US to be a triggered country and Finland is not

enter image description here

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.