I'm trying to get the values of all selected checkboxes and radio buttons from .js and pass it to a .jsx function by clicking on a button. The .jsx function contains 10 functions.
What i'm trying to achieve is that i take the strings from the arrays as function calls. Like
[value1, value2, value3....] to value1(); value2(); value3();
This is my code in the .js and .jsx:
//---------------------This is the .js part-----------------------------
$("#button").on('click', function () {
var csInterface = new CSInterface();
var selected = new Array();
$("input[type=checkbox]:checked").each(function () {
selected.push(this.value);
});
$("input[type=radio]:checked").each(function () {
selected.push(this.value);
});
if (selected.length > 0) {
csInterface.evalScript("secondFunction(" + selected + ")");
}
});
//---------------------This is the .jsx part-----------------------------
function secondFunction(selected){
//the functions below in this function have to be executed one after another
function value1{...};
function value2{...};
function value3{...};
};