Hello @tilou
There are different alternatives, that I’ll try to describe with an hypothetical example:
Assuming the DropDown field is the fieldname3, and the other three fields are: fieldname4, fieldname7 and fieldname9
If the choice selected in the fieldname3 is: 1, then, assign the values:
fielname4=5
fieldname7=12
fieldname9=1
and if the choice selected in the fieldname3 is: 2 assign the values:
fielname4=8
fieldname7=3
fieldname9=4
Note: the fields and values are hypothetical, only to describe the process.
First alternative:
– Insert a “HTML Content” field in the form with the following piece of code, as its content:
<script>
jQuery(document).on('change', '[id*="fieldname3_"]', function(){
var $ = jQuery,
v = $(this).val();
if(v==1)
{
$('[id*="fieldname4_"]').val(5);
$('[id*="fieldname7_"]').val(12);
$('[id*="fieldname9_"]').val(1);
}
if(v==2)
{
$('[id*="fieldname4_"]').val(8);
$('[id*="fieldname7_"]').val(3);
$('[id*="fieldname9_"]').val(4);
}
});
</script>
Second alternative, using a calculated field:
– Insert a calculated field in the form to be used as auxiliary, and associate to it the following equation:
(function(){
var v = fieldname3;
if(v==1)
{
getField(4).setVal(5);
getField(7).setVal(12);
getField(9).setVal(1);
}
if(v==2)
{
getField(4).setVal(8);
getField(7).setVal(3);
getField(9).setVal(4);
}
})()
Best regards.