Thanks for correcting..After changing element name, the code works partially.
Initially the service value is not appending,but i have added items manually to the checkbox (2 items in the screenshot 1)and after that the number of items i have added is updated from the service and the remaining values from the service is not getting reflected.
You can see from my below screenshot, i have 5 values from service.....since i have 2 elements added manually only those two values are getting reflected...
Do i need to add anything before the line? Inorder to add the item to the checkbox
Thanks for the reply...I have used the below script on the checkbox intialize event of AEM forms.I can able to get the value from backend in the variable ccName, but the checkbox with label is not getting generated (As well as, I dont find any error in console).Did i miss something?
Values for ccName from backend:
10005=New Vehicle Orchestration
success: function(result, textStatus, jqXHR)
//data - response from server
var ccName = result[i].ccID + '='+result[i].consentcontextName;
var ccID = result[i].ccID;
var checkboxes = $('.chk_.guideCheckBoxItem input');
var labels = $('.chk_.guideCheckBoxItem .guideWidgetLabel.right');