Score:0

How can one use the value of one field to enforce a minimum value on another field?

pl flag

I'm making a registration form for an event that will have a "sliding scale" fee system, but with minimum contributions based on the size of their organisation.

I want users to be able to set the size of the organisation that is paying their fee (from very small/volunteer led up to very large, well funded organisations) via radio buttons, and then to choose their contribution using a slider. Ideally the minimum contribution a user can choose via the slider should be determined by which radio button they select.

The final contribution will then be computed using the "computed twig" field.

I've got the fields set up (including the computed twig field), but I can't work out if its possible to have a "conditional minimum" on the slider - is this possible?

id flag
If you have some code already that isn't quite working, but that you think ought to be working, you should include it in the question.
leymannx avatar
ne flag
Sounds like you'll need custom JS
leymannx avatar
ne flag
If the organization some existing entity inside Drupal you may also be able to achieve it from hook_form_alter
Hodba Khalaf avatar
eg flag
If you share some code, we can help with more insights. HOOK_form_alter can work. Also Ajax callback can work as well.
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.