Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > alt attribute for input tag

Reply
Thread Tools

alt attribute for input tag

 
 
=?iso-8859-1?Q?Marcel_St=F6r?=
Guest
Posts: n/a
 
      11-28-2003
Hi all,

Why would the browser not produce a nice tooltip saying "hello" if I move
the cursor over the checkbox?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>

<body>
<input name="test" type="checkbox" value="1" alt="hello"/>
</body>
</html>

The code is valid XHTML...

Regards,
Marcel

 
Reply With Quote
 
 
 
 
brucie
Guest
Posts: n/a
 
      11-28-2003
in post <news:3fc743b4$0$242$ t>
Marcel Stör said:

> Why would the browser not produce a nice tooltip saying "hello" if I move
> the cursor over the checkbox?


because its not supposed to. use title="blah"


--
brucie
 
Reply With Quote
 
 
 
 
=?iso-8859-1?Q?Marcel_St=F6r?=
Guest
Posts: n/a
 
      11-28-2003

"brucie" <> schrieb im Newsbeitrag
news:bq7gqk$1vbtg1$...
> in post <news:3fc743b4$0$242$ t>
> Marcel Stör said:
>
> > Why would the browser not produce a nice tooltip saying "hello" if I

move
> > the cursor over the checkbox?

>
> because its not supposed to. use title="blah"


Hhmm, according the XHTML DTD there is an "alt" attribute for an "input"
tag. However, the spec doesn't talk about titles for input elements...

Regards,
Marcel

 
Reply With Quote
 
Chris Morris
Guest
Posts: n/a
 
      11-28-2003
Marcel Stör <marcel at frightanic dot com> writes:
> "brucie" <> schrieb im Newsbeitrag
> news:bq7gqk$1vbtg1$...
> > in post <news:3fc743b4$0$242$ t>
> > Marcel Stör said:
> >
> > > Why would the browser not produce a nice tooltip saying "hello" if I

> move
> > > the cursor over the checkbox?

> >
> > because its not supposed to. use title="blah"

>
> Hhmm, according the XHTML DTD there is an "alt" attribute for an "input"
> tag. However, the spec doesn't talk about titles for input elements...


title is a 'common' attribute. If you follow the DTD around a bit
it's there.

<input alt="..."> is only used by (some) browsers on <input
type="image"> as far as I know.

Anyway, 'alt' means alternative, so it only gets displayed when the
"primary" isn't. A checkbox can always be displayed by a browser in
the "primary" sense. Exactly what it looks like may vary, obviously.

'title' is for supplementary information, and a lot of popular
graphical browsers do display it on hover.

--
Chris
 
Reply With Quote
 
Steve Pugh
Guest
Posts: n/a
 
      11-28-2003
Marcel Stör <marcel at frightanic dot com> wrote:

>Why would the browser not produce a nice tooltip saying "hello" if I move
>the cursor over the checkbox?


The purpose of alt attributes is not to create tooltips. The fact that
some browsers do should not be taken as an indication that it will
always happen.

><input name="test" type="checkbox" value="1" alt="hello"/>
>
>The code is valid XHTML...


The alt attribute exists on input for the purpose of providing an
alternative to the input when the input can not be displayed.
In practice this almost always means as an alternative to the image in
<input type="image"> when images can not be displayed.

But there may be circumstances when a browser can't display your
checkbox and would display the alt attribute instead.

title is also a valid attribute of input (and most other elements) and
is intended for additional but unimportant information.
This may be displayed as a tooltip browser or may be made available to
the user in some other way.

If the information is important then you should include it in the page
itself and not rely on browsers that may or may not display a tooltip
under some circumstances.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <> <http://steve.pugh.net/>
 
Reply With Quote
 
Owen Jacobson
Guest
Posts: n/a
 
      11-28-2003
brucie wrote:

Brucie! You're back?
 
Reply With Quote
 
brucie
Guest
Posts: n/a
 
      11-28-2003
in post <news:M8Ixb.195315$jy.166158@clgrps13>
Owen Jacobson said:

> Brucie! You're back?


no, you're imagining things. go back to sleep and stop taking all the
blankets.

--
brucie
 
Reply With Quote
 
PeterMcC
Guest
Posts: n/a
 
      11-28-2003
brucie wrote:
> in post <news:3fc743b4$0$242$ t>
> Marcel Stör said:
>
>> Why would the browser not produce a nice tooltip saying "hello" if I
>> move the cursor over the checkbox?

>
> because its not supposed to. use title="blah"


Hi, brucie - good to hear from you.

--
PeterMcC
If you feel that any of the above is incorrect,
inappropriate or offensive in any way,
please ignore it and accept my apologies.

 
Reply With Quote
 
Andreas Prilop
Guest
Posts: n/a
 
      11-28-2003
Marcel Stör <marcel at frightanic dot com> wrote:

> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />


Unnecessary in HTML
<http://www.w3.org/International/O-HTTP-charset.html>
<http://ppewww.ph.gla.ac.uk/~flavell/charset/ns-burp.html>
and pointless in XHTML
<http://ppewww.ph.gla.ac.uk/~flavell/charset/checklist.html#xhtml>

Specify the encoding ("charset") via the HTTP header.
 
Reply With Quote
 
Leif K-Brooks
Guest
Posts: n/a
 
      11-28-2003
Marcel Stör wrote:
> Hhmm, according the XHTML DTD there is an "alt" attribute for an "input"
> tag. However, the spec doesn't talk about titles for input elements...


http://www.w3.org/TR/html4/interact/forms.html#h-17.4 Look under
"Attributes defined elsewhere".

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
alt.video.dvd, alt.video.dvd.software, alt.video.dvd.tech, rec.video.dvd.tech winterheat@gmail.com DVD Video 1 06-04-2006 12:43 PM
how do u invoke Tag b's Tag Handler from within Tag a's tag Handler? shruds Java 1 01-27-2006 03:00 AM
Re: alt.fan.weird-al,alt.autos.dodge,comp.lang.java.programmer,alt.fan.rumpole,alt.pl.kitesurfing HachiRoku Java 0 12-30-2004 05:18 AM
alt.autos.porsche928,rec.humor.oracle.d,alt.balordi.it,alt.computer,sci.med.laboratory . Computer Information 1 06-18-2004 08:44 AM
Re: sci.edu,sci.engr.color,alt.computer.security,alt.clubs.compsci,alt.comp.blind-users Brian Gaff Computer Security 0 06-17-2004 05:35 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57