mouseover event for text in a table

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bidalah@yahoo.com

    mouseover event for text in a table

    Hi everyone,

    I have a form that I created using tables. I want to create mouseover
    events which act on labels that are inside certain table cells so that
    when the mouse is over these label, something happens.

    Currenty when you swipe the mouse over them nothing happens. The same
    mouseover events DO work when I attach them to labels that are not
    inside a table cell.

    I can't find any documentation that says you can't do event handling on
    contents of a table cell. Is that the case? Please let me know.

    Thanks in advance.

  • Baconbutty

    #2
    Re: mouseover event for text in a table

    Hi

    You may need to be more explicit about your code, and particularly what
    you mean by "certain" table cells.

    I get mousoevers on all of the following labels:-

    <FORM method="post">
    <TABLE>
    <TR>
    <TD><LABEL for="fname" onmouseover="al ert('here')">Fi rst Name<INPUT
    type="text" name="firstname " id="fname"></LABEL></TD>
    <TR>
    <TD><LABEL for="lname" onmouseover="al ert('here')">La st
    Name</LABEL><INPUT type="text" name="lastname" id="lname"></</TD></TR>
    <TR>
    <TD><LABEL for="" onmouseover="al ert('here')">La st
    Name</LABEL></TD></TR>

    </TABLE>
    </FORM>


    I am not sure if this helps, but is it the LABEL or the INPUT you are
    interested in?

    It makes a difference whether the INPUT is inside the LABEL or not.

    In the above case, mouse over works fore both labels, but not for the
    second INPUT, because it its outside the label.

    Comment

    • Thomas 'PointedEars' Lahn

      #3
      Re: mouseover event for text in a table

      Baconbutty wrote:
      [color=blue]
      > [...][/color]

      JFTR:
      [color=blue]
      > <FORM method="post">[/color]

      The `form' element requires the `action' attribute.
      [color=blue]
      > <TABLE>
      > <TR>
      > <TD><LABEL for="fname" onmouseover="al ert('here')">Fi rst Name<INPUT
      > type="text" name="firstname " id="fname"></LABEL></TD>[/color]

      "text" is the default value of the `type' attribute of the `input' element;
      it can be safely omitted.
      [color=blue]
      > <TR>
      > <TD><LABEL for="lname" onmouseover="al ert('here')">La st
      > Name</LABEL><INPUT type="text" name="lastname" id="lname"></</TD></TR>[/color]
      ^^[color=blue]
      > <TR>
      > <TD><LABEL for="" onmouseover="al ert('here')">La st
      > Name</LABEL></TD></TR>[/color]

      The implied `for' attribute's value is of type IDREF and thus must not be
      empty. Either do not provide the attribute or provide it with an IDREF
      value.
      [color=blue]
      > [...][/color]


      PointedEars

      Comment

      Working...