Ver Mensaje Individual
  #2 (permalink)  
Antiguo 16/08/2007, 17:10
Avatar de derkenuke
derkenuke
Colaborador
 
Fecha de Ingreso: octubre-2003
Ubicación: self.location.href
Mensajes: 2.665
Antigüedad: 20 años, 7 meses
Puntos: 45
Re: document.formulario.submit()

Hola astut:

Supongo que eso es depende de qué DOCTYPE definas, yo he conseguido pasar el test definiendo una DTD transitional, y como me gusta más trabajar en XHTML, pues la he puesto XHTML, pero supongo que vale también en HTML sólo.

El código con el que he pasado el test ha sido éste:
Código PHP:
<!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" xml:lang="es" lang="es">
<
head>
<
meta http-equiv="Content-type" content="text/html;charset=iso-8859-1" />
<
meta name="Author" content="derkeNuke" />
<
title>Página nueva</title>
<
style type="text/css">
</
style>
</
head>

<
body>

<
form name="miForm" action="destino.html">
    <
label for="laCaja">Nombre: </label> <input type="text" name="caja" id="laCaja" />
    <
button type="submit">Enviame</button>
</
form>

</
body>
</
html
No ha habido ningún problema porque en ésa DTD que te especifico, podemos leer:
Cita:
Iniciado por http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
<!ELEMENT form %form.content;> <!-- forms shouldn't be nested -->

<!ATTLIST form
%attrs;
action %URI; #REQUIRED
method (get|post) "get"
name NMTOKEN #IMPLIED
enctype %ContentType; "application/x-www-form-urlencoded"
onsubmit %Script; #IMPLIED
onreset %Script; #IMPLIED
accept %ContentTypes; #IMPLIED
accept-charset %Charsets; #IMPLIED
target %FrameTarget; #IMPLIED
>
En donde %form.content es éste string:
(#PCDATA | %block; | %inline; | %misc;)*
Y a su vez %block, %inline y %misc son respectivamente:
p | %heading; | div | %lists; | %blocktext; | isindex |fieldset | table
a | %special; | %fontstyle; | %phrase; | %inline.forms;
noscript | %misc.inline;
....
Y podríamos seguir así con cada ENTITY (que empiezan por %).


Lo que quiere decir que el atributo name sí está permitido.


Quizás tengas problemas con tu DTD, pero te lo indica el propio validador si es así.


Un saludo.
__________________
- Haz preguntas inteligentes, y obtendrás más y mejores respuestas.
- Antes de postearlo Inténtalo y Búscalo.
- Escribe correctamente tus mensajes.