This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

lucasaid
lucasaid

Hey I'm currently trying to add a trigger to a form with multiple conditions.

Say if value1 is not checked or value3 is checked then value2 = hidden

Is there a way to do this or is it only confined to just one condition at the moment?

Last updated

Scott
Scott

You can get as sophisticated as you want by adding a JS asset, or even by filtering the form http://octobercms.com/docs/backend/forms#filter-form-fields

lucasaid
lucasaid

Ahh yeah I was thinking I might have to use some custom JS, just thought I'd see if there was a option to do it though the yaml file instead. As for the filterFields() that will help a lot.

Thanks!

ben20189
ben20189

I think an even easier solution would be to just use basic logic operators. Tried and tested: trigger: action: show field: section_type condition: value[video] || value[animation]

Troiscent
Troiscent

With the same logic, is it possible to add several actions to a fields using the trigger option of fields.yaml ?

For example, I want to show and make a field required depending on another field value.

I have that :

        trigger:
            action: show
            field: type
            condition: 'value[fixed]'

How can I add "required" to the action ?

1-5 of 5

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.