Changing CheckBox Status on HTML Page...

J

Julius Fenata

Thx to Mr. Gaurav, I have follow your instructions and thanks for your help,
the
checkbox change status when has a first click on it, but.. when I repeatedly
clicking on it, the value doesn't change anymore.., here is my code:

// HTML
function JSGeneratePackageID()
{
if (document.getElementById("chb_vIsDefect").selected)

// Can't work, how to change checkbox value?
document.getElementById("chb_vIsDefect").selected = false;

document.getElementById("lbl_vValue").innerText = "false";

else

// Can't work, how to change checkbox value?
document.getElementById("chb_vIsDefect").selected = true;

document.getElementById("lbl_vValue").innerText = "true";
}

// Code Behind
chb_vIsDefect.Attributes["onClick"] = "JSGeneratePackageID()";


Thx,
Julius F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,152
Latest member
LorettaGur
Top