ok i tried the code, and now my program is stuck in a loop, the browser is crashing when i click the SAVE NGSS button.
this is the code...
-----------------------------------------------------
var checkedItems = [];
//Note you need replace "mobilecheckboxgroup_38" "checkbox2_Standard" with your checkboxlist component name.
var checkedItems = jQuery('[dsid="checkboxgroup"] 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 = checkedItems.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));
var checkedItemsLSVValue = localStorage.getItem("checkedItemsLSV");
//Here you can change "stringToUser" in accordance with you needs.
//Note you need replace "labelName" with your label component(from 1st step) name.
Appery("NGSS_LSV").text(checkedItemsLSVValue);
-----------------------------------------------------
I can't debug in the browser, because the browsers Chrome and Firefox both crash.
What is going wrong?