About this question
How to get the selected value by dynamic id in Aura Component during aura: iteration? I'm in trouble getting the selected picklist value.using the below code, multiple select boxes are displayed by iteration. each selection has a dynamic id. now by using the dynamic id. I want to get the selected value of each select box. As per my code, it returns undefined.
hope someone helps me.
cmp File
js file
doSave1: function(component, event, helper) {
var inputfield = component.find("textfield").get("v.value");
var indexvar = document.getElementsByClassName("icon_image_canvas").length;
var imgURL = [];
for(var i=0; i < indexvar> var tempCanvas = document.getElementById( "targetIcon_" + i );
var statusName = component.find("statusName_" + i).get("v.value");
//var statusName = document.getElementsByClassName( "statusName_" + i )[0] ;
alert(statusName);
console.log("test: "+ statusName);
var _imgURL = tempCanvas.toDataURL("image/png");
imgURL.push(_imgURL.split(',', 2)[1]);
}
var action = component.get("c.createTorikago");
action.setParams({torikagoObj : component.get('v.torikagoSetupObj')});
//action.setParams({torikagoObj : component.get('v.torikagoSetupObj'), imgURL : imgURL});
action.setCallback(this,function(response){
helper.doResponseProcess(component, response, 5);
});
$A.enqueueAction(action);
},
Thanks in advance.