I've been struggling on this today:
I have a page with a checkboxlist, a html button, user will make some selection on the checkboxlist and hit the html button for further processing.
The problem is I need to know what are selected after the user clicked on the save button, the save button will need to pass that value to server side.
All I can see is the original status when the page is first loaded: if item1 is selected by default when it is generated, then I can see it; but if I uncheck it, I don't know the change.
My code is as below:
<input type="button" value="Save" onclick='SetSelectedText();' />
function SetSelectedText() {
debugger;
var selectedText = cblUserGroup.options[cblUserGroup.selectedIndex].innerHTML;
document.getElementById("HiddenField1").value = selectedText;
}
<asp:Panel ID="PnlUserGroup" runat="server" C ...
Go to the complete details ...