rfreshour
Programmer
- Jan 22, 2008
- 11
Something isn't right with my JS checkbox code. Here is the code for my 5 checkboxes:
alert('Returning: ' + tag_email_chk + tag_phone_chk + tag_voice_chk + tag_fax_chk + tag_done_chk);
document.getElementById('tagEmailChk').checked = tag_email_chk;
document.getElementById('tagPhoneChk').checked = tag_phone_chk;
document.getElementById('tagVoiceChk').checked = tag_voice_chk;
document.getElementById('tagFaxChk').checked = tag_fax_chk;
document.getElementById('tagDoneChk').checked = tag_done_chk;
The alert() function displays: falsetruefalsefalsefalse
and yet ALL checkboxes get checked!! What am I missing?
alert('Returning: ' + tag_email_chk + tag_phone_chk + tag_voice_chk + tag_fax_chk + tag_done_chk);
document.getElementById('tagEmailChk').checked = tag_email_chk;
document.getElementById('tagPhoneChk').checked = tag_phone_chk;
document.getElementById('tagVoiceChk').checked = tag_voice_chk;
document.getElementById('tagFaxChk').checked = tag_fax_chk;
document.getElementById('tagDoneChk').checked = tag_done_chk;
The alert() function displays: falsetruefalsefalsefalse
and yet ALL checkboxes get checked!! What am I missing?