Hello @johnny7075
You can activate/deactivate random fields from the equations.
For example, assuming you have four fields, fieldname1, fieldname2, and fieldname3, and you want to activate one of them and disable the rest, after the user selects an option of radio buttons or checkbox field fieldname4.
The fields’ names are hypothetical, and used only to describe the process.
Insert a calculated field in the form and enter the following equations:
(function(){
var list = [fieldname1|n, fieldname2|n, fieldname3|n],
index = FLOOR(RANDOM() * list.length);
if(fieldname4){
for(var i in list) {
if(i==index) ACTIVATEFIELD(list[i]);
else IGNOREFIELD(list[i])
}
}
})()
And that’s all.
Note I used some fields’ names with the |n
modifier. The plugin replaces the fields’ names in the equations with their corresponding values, but the |n
modifier tells the plugin you want to use the fields’ names and not their values.
Best regards.