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

J

John Wallace

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top