ooiyh
08-31-2006, 09:58 AM
Is this how you change checkbox value?
If so, it seems that I cant pass my value for SQL processing once I unchecked the checked box.
Javascipt:
function changevalue()
{
box = eval("document.form1.gopublic");
if (box.checked == false)
{
alert("disallow");
document.form1.gopublic[0].value = "disallow";
}
else
{
alert("allow");
document.form1.gopublic[0].value = "allow";
}
}
HTML
<input name="gopublic" type="checkbox" id="gopublic" value="allow" checked="checked" onclick="changevalue()"/>
If so, it seems that I cant pass my value for SQL processing once I unchecked the checked box.
Javascipt:
function changevalue()
{
box = eval("document.form1.gopublic");
if (box.checked == false)
{
alert("disallow");
document.form1.gopublic[0].value = "disallow";
}
else
{
alert("allow");
document.form1.gopublic[0].value = "allow";
}
}
HTML
<input name="gopublic" type="checkbox" id="gopublic" value="allow" checked="checked" onclick="changevalue()"/>