The dependent field changes depending on the selected value in another field
We are glad to introduce a new feature on the QuintaDB service.
The dependent field changes after selecting a specific value in another field, an condition that there is a Relationship between these fields' parent forms.
Now let's look at an example of creating and using dependent fields.
The task is to create a car order form and the car models and configurations will change depending on the brand you choose.
This form has one Radio button field type with three car brands.
3.1. Create a Relationship field.
In this example it's a relationship with the "Brand" field from the "Car Brands" form. Relationship type is Many-to-one, Radio button.
3.2. The second field will be Single line field "Model".
Cars models must match to the car brands.
We used the Many-to-one relationship type because one brand may have several models.
5.1. Add two fields with the Relationship type to the form. The first one is associated with the "Brand" field from the "Car Brands" form.
The second with the "Model" field from the "Car Models" form. In both cases, the Relationship type is Many-to-One, Radio button.
We open editing of the "Model" field.
5.2 Create the "Trim line" field. Single line type.
For convenience, we arrange fields on same line. See how to do that in this post.
The Dependent Field function available to this field, because we created the Relationship between the forms described in 3.1 item.
In other words, to unlock this function for relationship field in form “C”, you need to relate form “C” with form “A” and “B”, wherein there must be a relationship between “A” and “B” forms.
6.1. Check the box next to the Dependent field option.
6.2. Select the "Brand" field from dropdown list. Now the data will load to 'Model' field dynamically, based on the selected value in the 'Brand' field.
As you can see, the "Model" field change depending on the selected car brand.
This is how the table with records looks:
8.1. Add the Single line type field - "Enter your name"
8.2. The "Car Order" form must be related with all the previous ones.
The second field is the Relationship field to the "Brand" field from the "Car Brands" form. Relationship type is Many-to-one, Radio button.
Third - with the "Model " field from the "Car Models" form. Relationship type is Many-to-one, Radio button.
Fourth - with the "Trim line" field from the "Trim levels" form. Relationship type is Many-to-one, Radio button.
8.3. Enable the Dependent field option. The "Model" field depends on the "Brand" field, and the "Trim line" field on the "Model" field.
We use two dependent fields in this example, but there can be many more. The main thing is to comply with the condition described above: create a relationship with the forms, that have a relationship between each other.
Let's check it and add some records:
The table with records:
We hope you find this feature useful!