I want that when i check or uncheck the checkbox state,accordingly in label text is changed.
If i check the checkbox,then in label text is checked else unchecked.
But when i check or uncheck,firstly page is postbacked & secondly,in label nothing is coming..
If i check the checkbox,then in label text is checked else unchecked.
VB.NET:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
CheckBox1.Attributes.Add("oncheckedchanged", "javascript: return CheckboxState")
End Sub
<script language ="javascript" type ="text/javascript">
function CheckboxState()
{
var checkbox=document.getElementById("CheckBox1");
var lbl=document.getElementById ("Label1");
alert(checkbox.checked);
lbl.innertext=checkbox.checked;
return false;
}
</script>
But when i check or uncheck,firstly page is postbacked & secondly,in label nothing is coming..
Last edited by a moderator: