Foros del Web » Creando para Internet » HTML »

Problema al validar un form en W3C

Estas en el tema de Problema al validar un form en W3C en el foro de HTML en Foros del Web. Hola, tengo el siguiente código: @import url("http://static.forosdelweb.com/clientscript/vbulletin_css/geshi.css"); Código HTML: Ver original < form style = "margin-top: 20px; margin-bottom: 5px;" name = "send" action = "this.html" ...
  #1 (permalink)  
Antiguo 07/08/2011, 15:20
Avatar de PabloPF  
Fecha de Ingreso: mayo-2011
Ubicación: Ciudadano de un lugar llamado mundo!
Mensajes: 137
Antigüedad: 12 años, 11 meses
Puntos: 5
Problema al validar un form en W3C

Hola, tengo el siguiente código:
Código HTML:
Ver original
  1. <form style="margin-top: 20px; margin-bottom: 5px;" name="send" action="this.html" method="post">
  2.         <input type="text" name="Nombre" value="Nombre" class="inputsss" onfocus="this.className='inputs-coments-over';if (this.value == 'Nombre') {this.value = '';}" onblur="this.className='inputs-coments';if (this.value == '') {this.value = 'Nombre';}" />
  3.  
  4.         <input type="text" name="email" class="inputsss" value="Correo electrónico"  onfocus="this.className='inputs-coments-over';if (this.value == 'Correo electrónico') {this.value = '';}" onblur="this.className='inputs-coments';if (this.value == '') {this.value = 'Correo electrónico';}" />
  5.         <input type="text" name="tipo" class="inputsss" value="Escribe el motivo..."  onfocus="this.className='inputs-coments-over';if (this.value == 'Escribe el motivo...') {this.value = '';}" onblur="this.className='inputs-coments';if (this.value == '') {this.value = 'Escribe el motivo...';}" />
  6.    
  7.                 <textarea name="comentario" class="inputs-coments" cols="30" rows="8" value="Escribe el comentario..."  onfocus="this.className='inputs-coments-over';if (this.value == 'Escribe el comentario...') {this.value = '';}" onblur="this.className='inputsss';if (this.value == '') {this.value = 'Describe el problema...';}">Describe el problema...</textarea><div style="clear:both; text-align: left; margin-left: 55px;">
  8.               <input name="acept" value="si" type="checkbox" /><span style="text-aling: left; font-size: 12pt; color: #666;"> Acepto los <a onclick="this.target='_blank'" href="terms.html">terminos de uso</a>. </span></div>
  9.                         <input type="submit" name="send" style="width:100px;" tabindex="6" value="Enviar" />
  10.  
  11.     </form>
y en el W3C, al validar me salen estos fallos:

1:there is no attribute "name"

…gin-top: 20px; margin-bottom: 5px;" name="sendreport" action="/" method="post">


You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.

2:document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag

…'inputs-coments';if (this.value == '') {this.value = 'Correo electrónico';}" />


The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").

como soluciono el problema, gracias!
__________________
no hay justicia si la guerra esta justificada
  #2 (permalink)  
Antiguo 07/08/2011, 20:27
Avatar de zerokilled
Javascripter
 
Fecha de Ingreso: abril-2009
Ubicación: Isla del Encanto, La Borinqueña [+>==]
Mensajes: 8.050
Antigüedad: 15 años
Puntos: 1485
Respuesta: Problema al validar un form en W3C

Cita:
You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).
Cita:
Iniciado por translate.google.com
Usted ha usado el atributo mencionado anteriormente en el documento, pero el tipo de documento que está utilizando no es compatible con ese atributo de este elemento. Este error generalmente es causado por un uso incorrecto del tipo de "estricta" del documento con un documento que utiliza marcos (por ejemplo, debe utilizar la "transición" tipo de documento para obtener el atributo "target"), o mediante el uso de extensiones propietarias como proveedor "marginheight "(esto es por lo general fijado por el uso de CSS para lograr el efecto deseado en su lugar).
__________________
la maldad es una virtud humana,
y la espiritualidad es la lucha del hombre contra su maldad.
  #3 (permalink)  
Antiguo 08/08/2011, 05:44
 
Fecha de Ingreso: abril-2008
Ubicación: Santa Fe, Argentina
Mensajes: 41
Antigüedad: 16 años
Puntos: 14
Respuesta: Problema al validar un form en W3C

Cita:
You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).
Basicamente, se supone que con el DTD Strict los 'controles' (inputs, textareas y demás) de un formulario tengan nombre, pero no el formulario en sí.

Esto se puede ver en la sección Optional Attributes, el atributo name omite la S en la columna DTD.

http://www.w3schools.com/tags/tag_form.asp

En caso de que por alguna razón necesites tener este atributo declarado en el elemento form, vas a tener que cambiar el DTD.

Etiquetas: w3c, formulario
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 06:53.