[Ovillo] Validando XHTML

Tei oscar.vives en gmail.com
Lun Mayo 12 09:59:44 UTC 2008


On Sun, May 11, 2008 at 10:06 PM, Ardilla Roja <ardillaroja en gmail.com> wrote:
...
> <form action="misitio.com" method="post">
> <fieldset>
> <legend title="Forma para login de clientes">Clientes</legend>
> <label for="login[username]">Usuario:</label> <input type="text"
> name="login[username]" value="" />
> <label for="login[password]">Contrase&ntilde;a:</label> <input
> type="password" name="login[password]" value="" />
> <button class="submit">Entrar &raquo;</button>
> </fieldset>
> </form>
>
> ahora, al tratar de validad el xhtml, me da esto:
>
> Line 37, Column 24: character "[" is not allowed in the value of
> attribute "for".
>   <label for="login[username]">Usuario:</label> <input type="text" name="lo
>
> It is possible that you violated the naming convention for this
> attribute. For example, id and name attributes must begin with a
> letter, not a digit.
>
> Ya trate usar la entidad para el [ , pero no me funciona...

Supongo que [ no estara permitido en identificadores de for, prueba a
usar el id, en lugar del name, como en este ejemplo:

<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>k</title></head>
<body>
<form id="formularioEjemplo" method="post"
action="http://www.mipagina.com/accion.php">
  <fieldset title="Formulario de ejemplo">
    <legend>Prueba este formulario de ejemplo</legend>
    <label for="campo">Campo:</label><input type="text" id="campo"
name='cosa[test]' />
    <input type="submit" id="enviar" value="Enviar datos" />
  </fieldset>
</form>
</body>
</html>


Más información sobre la lista de distribución Ovillo