469,354 Members | 2,035 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,354 developers. It's quick & easy.

OnmosueOut and post not working in NN7

Hi - can anyone help with the code below please - when clicked, it
should add a table row to a table, with a checked checkbox (hidden) -
and if the user scrolls over the new row, it should hilight it - this
works.

However, the onmouseout does not remove the background color of the div
- it remains the same color as when the onmouseover set it.

Additionally, when the form is submitted, with the newly created row,
the checkbox is not recognised in request.form.

This script works perfectly in IE6, but I have problems in NN7 - can
anyone suggest where it may be going wrong?

Many thanks,

function addRowaddFact (cb_val) {
var table;
if (document.all)
table = document.all.tbladdFact;
else
table = document.getElementById('tbladdFact');
if (table && table.insertRow) {
var row = table.insertRow(table.rows.length);
var cell = row.insertCell(0);
cell.innerHTML = '<div title="Click to remove"
onMouseOver="this.style.cursor=\'hand\';this.style .background=\'#bbefff\
'" onMouseOut="this.style.background.color=\'transpar ent\'"
onclick=mtremRow(this) id="' + cb_val + '"\/>&nbsp;<input checked
type="checkbox" name="cbaddFact" style="display:;" value="' + cb_val +
'"\/><span class="search_input">&nbsp;&nbsp;<img
src="images/mt_bullet.gif" width="11"
height="10">&nbsp;&nbsp;'+cb_val+'<\/span><\/div>';
}
}
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #1
1 1051
"Mark" <an*******@devdex.com> wrote in message
news:40***********************@news.frii.net...
<snip>
... , with a checked checkbox (hidden) - ... <snip>This script works perfectly in IE6, but I have problems in
NN7 - can anyone suggest where it may be going wrong?
<snip>type="checkbox" name="cbaddFact" style="display:;" ...

<snip>

If by "hidden" you mean that the checkbox is - display:none; - then some
Mozilla/Netscape versions have taken the attitude that form elements
with CSS display properties set to "none" are not to be submitted with
the form. Then again, all Mozilla/Netscape versions like to see valid
CSS and I don't know if you can get away with - style="display:;" -,
maybe you can, I can't be bothered to look it up in the spec right now,
but it looks strange.

On the other hand a checkbox with a checked attribute that cannot be
clicked by the user is much the same as an <input type="hidden" ...>
element as the best you can hope for is to have a name/value pair sent
to the server with the submission.

Richard.
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Hardy Wang | last post: by
5 posts views Thread by tshad | last post: by
1 post views Thread by logik3x | last post: by
4 posts views Thread by qbproger | last post: by
7 posts views Thread by Ja NE | last post: by
23 posts views Thread by bc90021 | last post: by
11 posts views Thread by =?Utf-8?B?QkxVRVNUQVI=?= | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.