OnmosueOut and post not working in NN7

M

Mark

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=\'transparent\'"
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>';
}
}
 
R

Richard Cornford

... , with a checked checkbox (hidden) - ...
This script works perfectly in IE6, but I have problems in
NN7 - can anyone suggest where it may be going wrong?
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.
 

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,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top