How to block or auto-fill a field given another field's radio button choice?
How to block or auto-fill a field given another field's radio button choice?
Hello everyone!
I wanted to know if there's any information in the manuals that could allow you to auto-fill a field given another one's options?
I have a radio field with 3 options: "Yes", "No", "Both" ... in the case of No, or Both, another field, which is numeric, is automatically invalid or unusable and there's no need for it. I would like to have this kind of interaction auto-filling (setting it to 0 for the sake of my table's data), and blocking-out the field that is no longer needed.
The other option I believe would be good and I have yet to find, is have such field appear. If the answer is "Yes", i'd like the field to pop up, but haven't found anything in the examples about this either.
If there's nothing in the documentation, does anyone know how to do this?
Answers
If you are using the Editor then maybe
dependent()
is what you are looking for.Kevin
Kevin's suggestion is great. I am using this all the time. My users love it: They fill out a form from top to bottom (with many different field types) and the following fields to fill out are (sometimes) filled, shown or hidden automatically.
Here is an example ... lots of dependencies You can use it on one field or an array of fields. Don't forget the callback.
This is how my users get started:
Then after a few clicks it may look like this: