Foros del Web » Creando para Internet » HTML »

Validacion de codigo

Estas en el tema de Validacion de codigo en el foro de HTML en Foros del Web. Hola a todos Quisiera saber si alguien me puede decirme donde esta el error en este codigo <form action="<?php echo $mm_action_url ?>index.php" method="post" name="addtocart" id="addtocart<?php ...
  #1 (permalink)  
Antiguo 28/04/2009, 14:26
 
Fecha de Ingreso: octubre-2005
Mensajes: 23
Antigüedad: 18 años, 6 meses
Puntos: 0
Exclamación Validacion de codigo

Hola a todos

Quisiera saber si alguien me puede decirme donde esta el error en este codigo

<form action="<?php echo $mm_action_url ?>index.php" method="post" name="addtocart" id="addtocart<?php echo $i ?>" class="addtocart_form" <?php if( $this->get_cfg( 'useAjaxCartActions', 1 ) && !$notify ) { echo 'onsubmit="handleAddToCart( this.id );return false;"'; } ?>>

ya que al pasarlo por el HTML validator me dice lo siguiente:


Validation Output: 2 Errors

1. Error Line 499, Column 187: document type does not allow element "form" here; missing one of "object", "applet", "map", "iframe", "ins", "del" start-tag

…eAddToCart( this.id );return false;">



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>").
2. Error Line 608, Column 187: document type does not allow element "form" here; missing one of "object", "applet", "map", "iframe", "ins", "del" start-tag

…eAddToCart( this.id );return false;">



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>").


Desde ya agradezco su ayuda

Salu2
  #2 (permalink)  
Antiguo 28/04/2009, 14:30
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 10 meses
Puntos: 2135
Respuesta: Validacion de codigo

Tema trasladado desde PHP
  #3 (permalink)  
Antiguo 28/04/2009, 18:30
 
Fecha de Ingreso: noviembre-2008
Mensajes: 24
Antigüedad: 15 años, 5 meses
Puntos: 0
Respuesta: Validacion de codigo

puedes darnos todo el codigo? Creo que el error ocurre antes
  #4 (permalink)  
Antiguo 28/04/2009, 23:32
 
Fecha de Ingreso: octubre-2005
Mensajes: 23
Antigüedad: 18 años, 6 meses
Puntos: 0
Respuesta: Validacion de codigo

Hola

El codigo completo es este

Salu2


<?php if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
mm_showMyFileName(__FILE__);

$button_lbl = $VM_LANG->_('PHPSHOP_CART_ADD_TO');
$button_cls = 'addtocart_button';
if( CHECK_STOCK == '1' && !$product_in_stock ) {
$button_lbl = $VM_LANG->_('VM_CART_NOTIFY');
$button_cls = 'notify_button';
$notify = true;
} else {
$notify = false;
}
?>

<form action="<?php echo $mm_action_url ?>index.php" method="post" name="addtocart" id="addtocart<?php echo $i ?>" class="addtocart_form" <?php if( $this->get_cfg( 'useAjaxCartActions', 1 ) && !$notify ) { echo 'onsubmit="handleAddToCart( this.id ); return false;"'; } ?>>

<?php echo $ps_product_attribute->show_quantity_box($product_id,$product_id); ?><br />
<input type="submit" class="<?php echo $button_cls ?>" value="<?php echo $button_lbl ?>" title="<?php echo $button_lbl ?>" />
<input type="hidden" name="category_id" value="<?php echo @$_REQUEST['category_id'] ?>" />
<input type="hidden" name="product_id" value="<?php echo $product_id ?>" />
<input type="hidden" name="prod_id[]" value="<?php echo $product_id ?>" />
<input type="hidden" name="page" value="shop.cart" />
<input type="hidden" name="func" value="cartadd" />
<input type="hidden" name="Itemid" value="<?php echo $sess->getShopItemid() ?>" />
<input type="hidden" name="option" value="com_virtuemart" />
<input type="hidden" name="set_price[]" value="" />
<input type="hidden" name="adjust_price[]" value="" />
<input type="hidden" name="master_product[]" value="" />
</form>
  #5 (permalink)  
Antiguo 30/04/2009, 02:20
Avatar de tunait
Moderadora
 
Fecha de Ingreso: agosto-2001
Ubicación: Terok Nor
Mensajes: 16.805
Antigüedad: 22 años, 7 meses
Puntos: 381
Respuesta: Validacion de codigo

La parte de código php no es necesaria para averiguar qué código html está mal y complica la lectura para poder tratar de ayudarte.

Por favor, pon sólo la parte de código que le llega al navegador.

saludos
__________________
Javascript Códigos - Bambú difunde
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 21:22.