Alt attributes

For technical support for all editions of CSE HTML Validator. Includes bug reports.

Alt attributes

Postby RSteinwand » Fri Sep 02, 2011 12:56 pm

Hi Albert.

I use alt="required" for form validation on all my pages with forms and haven't had any trouble with it in any browser. This was a script I downloaded years ago, so it wasn't my invention.

When I add attributes with Dreamweaver, "alt" isn't available with all elements, but it is with input types.

Of course I get a bunch of warnings (that I know I could ignore :D) for pages that contain forms:

The "alt" attribute does not apply for text type inputs (this control defaults to a text control because the type is not specified with the "type" attribute). The "alt", "height", and "src" attributes applies only to image buttons. Consider removing this attribute.


I know you've dropped warnings for similar items that worked and didn't cause problems. This might be another one of them.
Rick
User avatar
RSteinwand
Rank IV - Intermediate
Rank IV - Intermediate
 
Posts: 161
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND

Re: Alt attributes

Postby RSteinwand » Fri Sep 02, 2011 1:00 pm

Hmmm.... just realized the warning goes away if I specify a type="text".
Rick
User avatar
RSteinwand
Rank IV - Intermediate
Rank IV - Intermediate
 
Posts: 161
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND

Re: Alt attributes

Postby Albert Wiersch » Fri Sep 02, 2011 4:59 pm

RSteinwand wrote:I use alt="required" for form validation on all my pages with forms and haven't had any trouble with it in any browser. This was a script I downloaded years ago, so it wasn't my invention.

When I add attributes with Dreamweaver, "alt" isn't available with all elements, but it is with input types.

Of course I get a bunch of warnings (that I know I could ignore :D) for pages that contain forms:

The "alt" attribute does not apply for text type inputs (this control defaults to a text control because the type is not specified with the "type" attribute). The "alt", "height", and "src" attributes applies only to image buttons. Consider removing this attribute.


I know you've dropped warnings for similar items that worked and didn't cause problems. This might be another one of them.


Hello,

I don't think this should be dropped as HTML5 specifies which attributes apply on "input" elements with a given type, so I think it is useful information. However, you should be able to right-click on the message (when displayed in CSE HTML Validator's editor) and disable the message (via the Exact Text Match option) if you want to ignore the warning.
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2361
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX

Re: Alt attributes

Postby Albert Wiersch » Fri Sep 02, 2011 5:02 pm

RSteinwand wrote:Hmmm.... just realized the warning goes away if I specify a type="text".


Hello,

I still get the warning. Perhaps you have disabled the message before? If a message is disabled using the "Exact Text Match" option, then there may be more than one message you would need to disable because the exact message text may be slightly different if you specify type="text" or omit the "type" attribute. Perhaps you disabled the message when type="text" is used but not when the "type" attribute is omitted?
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2361
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX


Return to CSE Tech Support

Who is online

Users browsing this forum: No registered users and 1 guest