Hello @marekurban
You can insert a calculated field in the form to be used as an auxiliary (you can hide the calculated fields by ticking a checkbox in its settings), and enter an equation similar to the following one:
For example, assuming the DropDown field is the fieldname1, and it has the choices A, B, and C. Also, you have the slider field fieldname2, and you want to assign the default values based on the following rules.
If the user selects the choice A, assign the default value 4000000. If the user selects choice B, assign the value 6000000, and finally, if the user selects choice C, assign the 8000000 value to the slider field.
(function(){
let value;
if(fieldname1 == 'A') value = 4000000;
if(fieldname1 == 'B') value = 6000000;
if(fieldname1 == 'C') value = 8000000;
getField(fieldname2|n).setVal(value);
})()Note I used the |n with fieldname2. The plugin replaces the fields’ names with their values before evaluating the equations. The |n modifier tells the plugin you are referring to the field’s name directly instead of its value.
Best regards.
