MyGen
08-17-2005, 10:19 PM
Firstly the scenario:
Two checkboxes (linethrough, underline), that when clicked, update an element specified by tagname and tagid, using a function I created (which works), changePropByTagId (A variation on getElementsById) .
Secondly, the code:
function checkcheckbox(tagname,tagid,underline,linethrough)
{
var style = "";
if (document.getElementById(underline).checked == true) { style += ' underline'; }
if (document.getElementById(linethrough).checked == true) { style += ' line-through'; }
if (style == "") { textDecoration = 'none'; } else { textDecoration = style; }
changePropsByTagId(tagname,tagid,'style.textDecoration',textDecoration);
}
Thirdly, what is supposed to happen?
Checks both checkboxes, if one is checked, appends underline and/or line-through to the var 'style' and then calls my property to change the element text-decoration property with a value of 'textDecoration'.
Fourthly, what is actually happening?
Firefox and Opera 8, working perfectly.
IE, choosing a single checkbox works fine, but upon selecting BOTH checkboxes, a 'Invalid Argument' error occurs.
Hope I've detailed this enough!
Any suggestions?
Many thanks,
Rob of MyGen.
Two checkboxes (linethrough, underline), that when clicked, update an element specified by tagname and tagid, using a function I created (which works), changePropByTagId (A variation on getElementsById) .
Secondly, the code:
function checkcheckbox(tagname,tagid,underline,linethrough)
{
var style = "";
if (document.getElementById(underline).checked == true) { style += ' underline'; }
if (document.getElementById(linethrough).checked == true) { style += ' line-through'; }
if (style == "") { textDecoration = 'none'; } else { textDecoration = style; }
changePropsByTagId(tagname,tagid,'style.textDecoration',textDecoration);
}
Thirdly, what is supposed to happen?
Checks both checkboxes, if one is checked, appends underline and/or line-through to the var 'style' and then calls my property to change the element text-decoration property with a value of 'textDecoration'.
Fourthly, what is actually happening?
Firefox and Opera 8, working perfectly.
IE, choosing a single checkbox works fine, but upon selecting BOTH checkboxes, a 'Invalid Argument' error occurs.
Hope I've detailed this enough!
Any suggestions?
Many thanks,
Rob of MyGen.