viernes, 30 de abril de 2010

Accesibilidad Web

If you are worried about web accessibility in your web page I'm going to give you some guidelines to solve the most common accessibility problems. First of all, you have to know what mistakes you have made. You can figure it out using this web page:

http://www.tawdis.net

Once you know the mistakes in your web page we can pass to try to solve them. You'll be able to resolve some problems using this.

1) A form could be somethin like that:

<form>
First name:
<input type="text" name="firstname" />
<br />

Last name:
<input type="text" name="lastname" />
</form>


If we want the form to be accessible we must to change it like this:

<form>
<label for="firstname">First name:
<input id="firstname" type="text" name="firstname" />
</label>
<br />
<label for="lastname"> Last name:
<input id="lastname" type="text" name="lastname" />
</label>
</form>


2) In order to create a button that send us to the previous page, we would do:

<a href="javascript:history.go(-1)">

But if we want this to be accessible we would have to change it like this:

<a href="<?=$_SERVER['HTTP_REFERER']?>" id='atras'> Atras </a>

<script type='text/javsacript'>
//<![CDATA[
document.getElementById('atras').onclick = function(){
history.go(-1);
return false;
}
//]]>
</script>

No hay comentarios:

Publicar un comentario