mouseover event for text in a table

B

bidalah

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.
 
B

Baconbutty

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="alert('here')">First Name<INPUT
type="text" name="firstname" id="fname"></LABEL></TD>
<TR>
<TD><LABEL for="lname" onmouseover="alert('here')">Last
Name</LABEL><INPUT type="text" name="lastname" id="lname"></</TD></TR>
<TR>
<TD><LABEL for="" onmouseover="alert('here')">Last
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.
 
T

Thomas 'PointedEars' Lahn

Baconbutty said:
[...]
JFTR:

<FORM method="post">

The `form' element requires the `action' attribute.
<TABLE>
<TR>
<TD><LABEL for="fname" onmouseover="alert('here')">First Name<INPUT
type="text" name="firstname" id="fname"></LABEL></TD>

"text" is the default value of the `type' attribute of the `input' element;
it can be safely omitted.
<TR>
<TD><LABEL for="lname" onmouseover="alert('here')">Last
Name</LABEL><INPUT type="text" name="lastname" id="lname"></</TD></TR> ^^
<TR>
<TD><LABEL for="" onmouseover="alert('here')">Last
Name</LABEL></TD></TR>

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.


PointedEars
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top