OnmosueOut and post not working in NN7

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark

    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.tb laddFact;
    else
    table = document.getEle mentById('tblad dFact');
    if (table && table.insertRow ) {
    var row = table.insertRow (table.rows.len gth);
    var cell = row.insertCell( 0);
    cell.innerHTML = '<div title="Click to remove"
    onMouseOver="th is.style.cursor =\'hand\';this. style.backgroun d=\'#bbefff\
    '" onMouseOut="thi s.style.backgro und.color=\'tra nsparent\'"
    onclick=mtremRo w(this) id="' + cb_val + '"\/>&nbsp;<input checked
    type="checkbox" name="cbaddFact " style="display: ;" value="' + cb_val +
    '"\/><span class="search_i nput">&nbsp;&nb sp;<img
    src="images/mt_bullet.gif" width="11"
    height="10">&nb sp;&nbsp;'+cb_v al+'<\/span><\/div>';
    }
    }


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
  • Richard Cornford

    #2
    Re: OnmosueOut and post not working in NN7

    "Mark" <anonymous@devd ex.com> wrote in message
    news:40071b53$0 $70300$75868355 @news.frii.net. ..
    <snip>[color=blue]
    >... , with a checked checkbox (hidden) - ...[/color]
    <snip>[color=blue]
    >This script works perfectly in IE6, but I have problems in
    >NN7 - can anyone suggest where it may be going wrong?
    >[/color]
    <snip>[color=blue]
    >type="checkbox " name="cbaddFact " style="display: ;" ...[/color]
    <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.


    Comment

    Working...