Removing attributes from an HTML Object
Is there a way to remove an attribute from an HTML object.
I am still working on the checkbox thing. My direct problem is that when the "checked" property is set on an HTML input element, the checkbox always displays as checked (unless I missed something).
eg rendered code:
still displays as a checked box.
So, is there a way in the object create function to say something along the lines of
so that the attribute is only set if the checkbox should be checked?
Also is there a way to have the attribute be removed? (eg when the checkbox is unchecked, and the html.refresh() is called the input is not rendered as checked)
I suppose I could manipulate the htmlObj._attributes property, but that is kind of hackish.
Or if this could be solved with some fundametal HTML knowledge, that would be even better.
Thanks
I am still working on the checkbox thing. My direct problem is that when the "checked" property is set on an HTML input element, the checkbox always displays as checked (unless I missed something).
eg rendered code:
<input type="checkbox" name="foo" value="bar" checked="false|OFF"/>
still displays as a checked box.
So, is there a way in the object create function to say something along the lines of
if (this.getItemProperty("text")==mycheckedValue) {
obj.setAttribute("checked","true");
}
so that the attribute is only set if the checkbox should be checked?
Also is there a way to have the attribute be removed? (eg when the checkbox is unchecked, and the html.refresh() is called the input is not rendered as checked)
I suppose I could manipulate the htmlObj._attributes property, but that is kind of hackish.
Or if this could be solved with some fundametal HTML knowledge, that would be even better.
Thanks
gbegley
May 10,