coders4hire
IS-IT--Management
trollacious answered another one of my questions today, and I'm trying to modify the code to work with this problem. For ANY unchecked boxes in my form, I want to pass a value of '0'. Can I do this without identifying every box?
Is this efficient below?
Doug
Is this efficient below?
Code:
function VerifyForm(subscribeForm){
var myblank = '';
//list of checkboxes to evaluate
var cbox = ['a1','a2','a3'];
for (var i=0;i<cbox.length;i++) {
var onecbox = document.getElementById(cbox[i])
var checked = onecbox.checked;
if (checked)
{
myblank == cbox[i].value;
}
else
{
myblank == '0';
}
}
document.getElementById(this).value = myblank;
}
Doug