Try our conversational search powered by Generative AI!

Göra fältet för "alternativ text" för bilder i bildhantering obligatoriskt

Hej, det är ju viktigt att ha alternativtexter för bilder på webben. Kan man göra så att fältet i bildhanteraren för alt-text blir obligatoriskt?
May 29, 2009 15:47


 Tvyärr finns det nog inget enkelt sätt att lösa detta på förutom att lära redaktörerna att alltid sätta det om det ska använda bilder. Det skulle eventuellt gå att lösa det genom att ändra i funktionerna för episerver och modifiera själva länkdialogen som dyker upp och lägga till en validator. Alltså ändra i den aspx som styr denna popup men då kommer detta att bli osupportat tyvärr.

Så enklast är att lära kollegor hur viktigt detta är och varför det är så viktigt. :)

Jun 01, 2009 10:58

Guess the most easy way is to add to the SavingEvent a check if the image property have value that the image text also have. If not abort the save and return an error message.

Thats 5 lines of code.

The only problem with this approce is that there could be times you want to allow saving of only image paths without abstract text(import for instance)


Jun 01, 2009 22:49

I guess you are speaking about accessibilty now. Correct?

First of all – in 99% of the cases you should not add an ALT text to an image. Or to be more precise- it should be empty - no space between.

<img src="bullet.gif" alt="" />

Do NOT omit the ALT tag completely!

Only when you need the ALT text for understanding it should be used.  It must be "meningsbärande" - essentiall. Unnecessary ALT text makes content less comprehensible for blind people. Use them with care...

For example:
- photos, telling someone that this is a picture of "Maria Wasing" is not necessary. If you´re blind you´ll never catch a glimpse of her. And you certainly will not wanna know that there is a picture of her. Remember that the blind person hear this unecessary information. Really annoying.

- an ALT text saying that this is a picture of how a company is organized is not necessary. To make sence you have to describe the whole organization and that will probably be impossible in the ALT field. True :)
Use ordinary text instead. Or the long_desc field.

- if you have titles made by .gif or .jpg. an ALT text might be tempting. But since you cannot TAG an ALT text as an H1, H2, H3 you make a mess for blind people. They need to browse the content by building special indexes made out of tagged titles. So do not use titles made by pictures. But if you cannot avoid – use ALT text here.

-  if you use banners for example – perhaps you then are tempted to write an ALT text. But the banner has a link  - use the ALT property of the link instead. If you specify an ALT text for both you will make the poor blind visitor frustrated (hearing two alt texts). The most important is the ALT text describing here where the link will take you. Isn´t it? Put the ALT text on the link!

- design elements, arrows, dots, separators, "decorations" without meaning - ALT texts are definitely FORBIDDEN! The purose of  design & decoration is helping the eye and make it more beatiful. This information should not be described in loudspeakers. Information overload has to be avoided. Add this stuff with help of CSS if you can.

- if you have a logotype – then you must add an ALT – text

Mentioning links - try to avoid ALT texts here too. Use a comprehendable link title instead. Makes it even more accessible and useable for both people who are blind and not

A simple test how to decide
If a friend of you calls you and ask you to find & read information for him/her at a website. If you actually DESCRIBE the pictures to him/her - then you should use ALT field.

Conclusion - do not make ALT texts mandatory & set it  ALT="" - if input is missing
Forcing people to "add nothing" will make them confused. By making it mandatory you'll probably make people add rubbish or a " ". So I guess you have to do some tricky coding behind to make this easy to achieve. And good instructions and leadtexts.

Read more at Verva/ 24-timmars myndigheten .  Search for “meningsbärande bilder”




Edited, Oct 30, 2009 13:05

I´ve edited and added <img src="bullet.gif" alt="" />

When I speak about no ALT text I do not mean omitting it completely. Just make it blank. No space in between. IMPORTANT!

Edited, Oct 30, 2009 14:33
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.