J
Julius Fenata
Dear all,
I have checkbox on my webform, and I want that when I click my checkbox, it
should change status between true or false...
Here is my code,
// Code Behind
CheckBox1.Attributes["onClick"] = "JSGeneratePackageID()";
How to make my CheckBox has value? Because in the html page my checkbox
doesn't have any value? I assign checkbox value to a label, but it doesn't
show up.
// HTML Code
function JSGeneratePackageID()
{
document.getElementById("Label1").innerText =
document.getElementById("CheckBox1").innerText; // Didn't work.
}
Because I need to use checkbox value to switch the checkbox value, whenever
it has 'click' event.., like this...
//HTML Code
if (document.getElementById("CheckBox1").innerText = = "False")
document.getElementById("CheckBox1").innerText = "True";
document.getElementById("Label1").innerText = "True";
else
document.getElementById("CheckBox1").innerText = "False";
document.getElementById("Label1").innerText = "False";
Thx,
Julius F
I have checkbox on my webform, and I want that when I click my checkbox, it
should change status between true or false...
Here is my code,
// Code Behind
CheckBox1.Attributes["onClick"] = "JSGeneratePackageID()";
How to make my CheckBox has value? Because in the html page my checkbox
doesn't have any value? I assign checkbox value to a label, but it doesn't
show up.
// HTML Code
function JSGeneratePackageID()
{
document.getElementById("Label1").innerText =
document.getElementById("CheckBox1").innerText; // Didn't work.
}
Because I need to use checkbox value to switch the checkbox value, whenever
it has 'click' event.., like this...
//HTML Code
if (document.getElementById("CheckBox1").innerText = = "False")
document.getElementById("CheckBox1").innerText = "True";
document.getElementById("Label1").innerText = "True";
else
document.getElementById("CheckBox1").innerText = "False";
document.getElementById("Label1").innerText = "False";
Thx,
Julius F