Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

1.0 -> 1.1 Undocumented (?) change in behaviour!

0 views
Skip to first unread message

John Wallace

unread,
Sep 7, 2003, 10:23:53 AM9/7/03
to
Hi,
I built a custom control in VS 2002 (1.0) that contained a dynamic
list of checkboxes. I output client script to process click events on
the checkboxes and, because the checkbox <input> controls were
rendered inside a <span> tag, I used the following to access the
"checked" property:

function MyFunction(objCheckBox)
{
//Note the use of "firstChild" to access the checkbox
bChecked = objCheckBox.firstChild.checked ? "1" : "0";
}

called from the following code, rendered by .Net 1.0:

<span onclick="javascript:return MyFunction(this);">
<input id="chklstItem_Item1" type="checkbox" name="chklstItem:Item1"
/>
<label for="chklstItem_Item1">Item1</label>
</span>

I deployed the project to a .Net Server 2003 running the 1.1 Framework
and the code stopped working because the "input" control no longer
renders inside a "span" tag!!! It's now:

<input id="chklstItem_Item1" type="checkbox" name="chklstItem:Item1"
onclick="javascript:return MyFunction(this);" />

...so "firstChild" is redundant. I've seen posts on the annoying
"input inside a span tag" problem but I've never seen anything that
said MS fixed in in 1.1.

Anyone seen the docs on this? Or is it due to me using a 1.0 project
in a 1.1 environment perhaps?

Thanks,
John

0 new messages