Ver Mensaje Individual
  #2 (permalink)  
Antiguo 10/03/2011, 21:48
Avatar de Marvin
Marvin
Colaborador
 
Fecha de Ingreso: febrero-2005
Ubicación: global $Chile->Santiago;
Mensajes: 1.991
Antigüedad: 19 años, 2 meses
Puntos: 81
Respuesta: Problema con checkbox

Trata asi:
Código PHP:
<?php
do { 
    
$nombre_talla $row_talla['nombre_talla'];
    
$arT explode(',',$nombre_talla);
    
$numT count($arT);
    for(
$a=0;$a<$numT;$a++){
        if(
$m != 'checked="checked"'){
            
$m strtoupper($arT[$a])=="MARON"?'checked="checked"':''
        }
        if(
$v != 'checked="checked"'){ 
            
$v strtoupper($arT[$a])=="VERDE"?'checked="checked"':''
        }
        if(
$y != 'checked="checked"'){ 
            
$y strtoupper($arT[$a])=="AMARILLO"?'checked="checked"':''
        }
        if(
$b != 'checked="checked"'){ 
            
$b strtoupper($arT[$a])=="BLANCO"?'checked="checked"':''
        }
    }
    
$checkbox '
Maron <input type="checkbox" name="entalla[]" '
.$m.' id="entalla[]" value="Maron"/>
Verde <input type="checkbox" name="entalla[]" '
.$v.' id="entalla[]" value="Verde"/>
Amarillo <input type="checkbox" name="entalla[]" '
.$y.' id="entalla[]" value="Amarillo"/>
Blanco <input type="checkbox" name="entalla[]" '
.$b.' id="entalla[]" value="Blanco"/>';
    print 
$checkbox;
} while (
$row_talla mysql_fetch_assoc($talla));
?>
Suerte!
__________________
El que dice "Solo sé que nada sé", esta asumiendo que sabe algo.
Lea las FAQ's!