Ver Mensaje Individual
  #8 (permalink)  
Antiguo 03/05/2007, 15:13
Avatar de AlZuwaga
AlZuwaga
Colaborador
 
Fecha de Ingreso: febrero-2001
Ubicación: 34.517 S, 58.500 O
Mensajes: 14.550
Antigüedad: 24 años
Puntos: 535
Re: ID vs NAME en los nombres de los campos

Mi estimado :Colaborador: (edit... me refiero a Myakire ), sírvase usted de validar este xHTML en http://validator.w3.org/ :


Código:
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<form id="form1" name="form1" method="post" action="">
  <label for="nombre">Nombre</label>
  <input type="text" name="nombre" id="nombre" />
  <br />
  <label for="apellido">Apellido</label>
  <input type="text" name="apellido" id="apellido" />
  <p>Seleccione fruta preferida:</p>
  <label>Manzana</label>
  <input type="checkbox" name="fruta" value="manzana" id="fruta" />
  <label>Naranja</label>
  <input type="checkbox" name="fruta" value="naranja" id="fruta" />
  <br />
  <input type="submit" name="Submit" value="Submit" id="Submit" />
</form>
</body>
</html>





Cita:
This page is not Valid XHTML 1.0 Transitional!

Below are the results of checking this document for XML well-formedness and validity.

1. Error Line 19 column 58: ID "fruta" already defined.

Código:
        <input type="checkbox" name="fruta" value="naranja" id="fruta" />
An "id" is a unique identifier. Each time this attribute is used in a document it must have a different value. If you are using this attribute as a hook for style sheets it may be more appropriate to use classes (which group elements) than id (which are used to identify exactly one element).


2. Info Line 17 column 58: ID "fruta" first defined here.

Código:
        <input type="checkbox" name="fruta" value="manzana" id="fruta" />


Edit:

Cita:
Iniciado por u_goldman
El uso del atributo ID también es importante por cuestiones de usabilidad.
Completamente de acuerdo
__________________
...___...