Hello,
I'm trying to figure out how to create a condition involving a negation. Eg. Enable current field IF previous field value IS NOT something. I think it's not implemented yet, at a field level.
Thank you!
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | add_support_for-2858142-4.patch | 827 bytes | jrockowitz |
Comments
Comment #2
jrockowitz commentedPlease provide a concrete example with a code snippet.
Comment #3
mariuscmr commentedIt's about cities in Romania.
I have a city autocomplete field, a county field (Select2) and Sector (Select2).
Bucharest does not belong to a county, but it's splitted into sectors (1 to 6).
The first field to fill is City.
In normal conditions, county field is required and sector optional.
The logic would be this:
If people fill in "Bucharest", disable County and enable Sector.
AND
Make County optional and Sector required.
If people fill in OTHER but Bucharest, leave county enabled and sector disabled
AND
Make County required and Sector optional.
If I try to make county required by default, when people fill in Bucharest, I the form throws an "Illegal choice" error.
Do I have to start will county and sector optional and make them required depending on the conditionals?
The snippet you asked me for is working but not in my desired way (county and sector still remain optional, regardless of city choice).
I will paste here only that part, not the whole form.
Thanks.
Translation for values in the form are:
Localitate = City
Judet = County
Sector is the same
Comment #4
jrockowitz commentedYour use case is very complex.
The below optional and required states are definitely conflicting.
You have convinced me to add the 'Value is not' (!value) trigger to the conditional logic UI.
Comment #6
jrockowitz commentedI committed the patch. Please download and review the latest dev release.