Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/08/2008, 16:15
Avatar de hoberwilly
hoberwilly
 
Fecha de Ingreso: julio-2008
Ubicación: Lima - Perú
Mensajes: 769
Antigüedad: 15 años, 11 meses
Puntos: 2
Pregunta Ayuda...boton continuar

Estimados compañeros, les interrumpo para solicitarle un favor de como implementar lo sgte: el tema esta en que existe una caja de texto el cual no permite actualizar las cantidades en cajas vacias...hasta ahi oka
Ahora el tema esta en que existe un boton de continuar (img/button_continue.gif), el cual tambien quisiera que no permita que las cajas de texto pasen sin datos al siguiente enlace LOGIN.PHP

VERCARRITO.PHP
------------------------
<?php
session_start();
error_reporting(E_ALL);
@ini_set('display_errors', '1');
if(isset($_SESSION['carro']))
$carro=$_SESSION['carro'];else $carro=false;
?>
<html>
<head>
<title>PRODUCTOS AGREGADOS AL CARRITO</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script language="javascript" type="text/javascript">
function vacio(q) {
for ( i = 0; i < q.length; i++ ) {
if ( q.charAt(i) != " " ) {
return true
}
}
return false
}
function valida(F) {
if( vacio(F.cantidad.value) == false) {
alert("Tiene que ingresar una cantidad")
return false
} else {
return true
}
}
</script>
</head>

<body>
<?php
if($carro){
?>
<table>
<tr bgcolor="#3399CC" align="center"class="tit">
<td width="4%"></td>
<td width="5%">Cód.</td>
<td width="37%">Producto</td>
<td width="10%">Precio(S/.)</td>
<td width="10%">Cant. (pares)</td>
<td width="4%"></td>
</tr>
<?php
$color=array("#FFFFFF","#F0F0F0");
$contador=0;
$suma=0;
foreach($carro as $k => $v){
$talla=$v['talla'];
$subto=$v['cantidad']*$v['precio'];
$suma=$suma+$subto;
$contador++;
?>
<form name="a<?php echo $v['identificador'] ?>" method="post" action="agregacarrito.php?<?php echo SID ?>" id="a<?php echo $v['identificador'] ?>" onSubmit="return valida(this);">
<tr bgcolor="<?php echo $color[$contador%2]; ?>" class='prod'>
<td width="5%" align="center"><a href="borracarrito.php?<?php echo SID ?>&id=<?php echo $v['id'] ?>"><img src="img/eliminar.gif"></a></td>
<td><?php echo $v['id'] ?></td>
<td><?php echo $v['producto'] ?></td>
<td align="right"><?php echo $v['precio'] ?></td>
<td align="center">
<input name="cantidad" type="text" id="cantidad" value="<?php echo $v['cantidad'] ?>" size="2" maxlength='4'>
<input name="id" type="hidden" id="id" value="<?php echo $v['id'] ?>"></td>
<td width="8%" align="center"><input type="image" name="imageField" src="img/actualizar.gif"></td>
</tr>
</form>
<?php }?>
</table>
<p>
<table>
<td><a href="login.htm?<?php echo SID;?>&costo=<?php echo $suma; ?>"><img src="img/button_continue.gif"></a></td>
</table>

<?php }else{ ?>
<p align="center"><span class="prod">No hay productos seleccionados!</span>
<?php }?>
</p>
</body>
</html>

Agradeciendo de antemano su colaboracion.