ok, so I can't seem to get this code to work
I see what you mean about the "checkbox component" vs the "CheckboxGroup component", but there doesn't seem to be a difference for my purposes. Or is there?
I am having trouble implementing the code to show the user what they have chosen.
I used...
----------------------------------------------------------------------------------------------------------
var checkedItems = [];
//Note you need replace "mobilecheckboxgroup_38" "checkbox2_Standard" with your checkboxlist component name.
var ckeckedItems = jQuery('[dsid="checkbox2_Standard"] input[type="checkbox"]:checked');
console.log("Checked items count = " + checkedItems.length);
//Iterate through checked items.
for(var i = 0; i < checkedItems.length; i++){
var checkedItem = jQuery(checkedItems);
var checkedText = checkedItem.closest("span").find("label").text();
var checkedValue = checkedItem.val();
//Just out this value to browser console. Please check out it to see results.
console.log("checkedItem[" + i + "] = " + checkedValue);
//Here you can use "checkedValue" JS variable as you need.
checkedItems.push({text: checkedText, value: checkedValue});
}
localStorage.setItem("checkedItemsLSV", JSON.stringify(checkedItems));
-----------------------------------------------------------------------------------------------------------
the "add JS" is this return'{"TopicChosen":"'+value+'"}';
-----------------------------------------------------------------------------------------------------------
I appreciate your gift, the javascript above stores the data into "checkedItemsLSV", a local variable which I have created.
so I attempted to set the properties of a LABEL to the localvariable checkedItemsLSV, but the computer makes the label as ...
[]
so I don't understand where my problem or problems are happening.