[Feature Request] Conditionally Set Value Of Field Based On Value Of Another

Support MB Conditional Logic [Feature Request] Conditionally Set Value Of Field Based On Value Of Another

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #40838
    James CooperJames Cooper
    Participant

    It would be nice to have the ability to set conditional logic to change the value of a field based on the value of another field. Similar to this topic:

    https://support.metabox.io/topic/update-a-cf-stored-in-a-custom-database-based-on-another-cf/?swcfpc=1

    I know this can be coded, but instead of having to code it, it'd be nice to have the ability to set this up through the conditional logic interface.

    For instance, I have a button group of 2 buttons and conditions set to show 1 of 2 text fields depending on the button selected.

    For this use case, I want to allow users to save data in text field #1 [OR] text field #2, depending on the button they select. I do not want them to be able to save data in both.

    This is how things currently work:

    1. I set up a button group with two buttons
    2. I set up two text fields, each shown depending on the selected button.
    3. Let's assume the user selects button #1 to show text field #1 (text field #2 remains hidden), and the user then adds data to text field #1.
    4. The user then selects button #2, which shows text field #2 (and hides text field #1), and then adds data to text field #2.
    5. At this point, there is data in both text field #1 and text field #2.
    6. When the user saves the post, the data in both text field #1 and text field #2 will be saved to the database.

    This may work fine in many use cases, but there are cases (in this example) where if the user adds data to one of the text fields, we want to ensure that the other text field is set to empty/NULL or even some other value.

    I'm sure there are also many other use cases where one field's value might depend on another's value.

    I understand this can be accomplished with code, which I'm currently doing. But, it would be nice (from a usability perspective) to have an interface in the MB Builder that allows for conditionally setting the values of fields based on the values of other fields.

    Hopefully, you can add this feature request to your roadmap.

    #40847
    PeterPeter
    Moderator

    Hello,

    Thank you for your suggestion.

    Currently, MB Conditional Logic only supports showing/hiding fields based on the value of other fields. It does not support settings/changing the value of a field based on the value of other fields like that. I will inform the development team to consider supporting this feature in future updates.

    #41290
    mistergekomistergeko
    Participant

    This would really be an awesome feature and it's sometimes very much needed!

    #43607
    YasmineYasmine
    Participant

    WS Forms lets you do this very well, it would be great to add that functionality to native metabox

    #43790
    TomTom
    Participant

    +1 for this feature request! Really surprised it is not possible with Metabox.

    I have a select box with items. Depending on what item is selected I want to populate another text field with some text.

    #44095
    collinsonfamily@gmail.com[email protected]
    Participant

    +1 for this!

    #46720
    Rebecca RobertsonRebecca Robertson
    Participant

    We definitely need this functionality.

    Several of my forms would be greatly improved and simplified if I had the ability to say "if taxonomy 1 = A then taxonomy 2 = B" or "if taxonomy 1 = B then taxonomy 2 includes C, D, E and F".

    #47151
    Rebecca RobertsonRebecca Robertson
    Participant

    Add my +1 for this feature.

    #47834
    Tanja KropfTanja Kropf
    Participant

    I'm giving this another upvote.

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.