[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
- This topic has 8 replies, 8 voices, and was last updated 1 month ago by
Tanja Kropf.
-
AuthorPosts
-
March 5, 2023 at 12:54 AM #40838
James Cooper
ParticipantIt 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:
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.
March 6, 2023 at 6:44 PM #40847Peter
ModeratorHello,
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.
April 2, 2023 at 4:21 AM #41290mistergeko
ParticipantThis would really be an awesome feature and it's sometimes very much needed!
October 25, 2023 at 4:10 AM #43607Yasmine
ParticipantWS Forms lets you do this very well, it would be great to add that functionality to native metabox
November 12, 2023 at 1:18 AM #43790Tom
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.
December 14, 2023 at 9:39 PM #44095[email protected]
Participant+1 for this!
October 18, 2024 at 8:14 PM #46720Rebecca Robertson
ParticipantWe 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".
December 10, 2024 at 7:17 PM #47151Rebecca Robertson
ParticipantAdd my +1 for this feature.
March 16, 2025 at 4:42 AM #47834Tanja Kropf
ParticipantI'm giving this another upvote.
-
AuthorPosts
- You must be logged in to reply to this topic.