Ver Mensaje Individual
  #8 (permalink)  
Antiguo 28/07/2009, 13:02
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Respuesta: editar listas de seleccion

Como te comento tienes que comparar el valor, y si es igual imprimes:
Código php:
Ver original
  1. <SELECT NAME='creligion'>
  2. <OPTION value ="C" <?php if ($valor_de_bdd == 'C') { echo 'selected="selected"'; } ?>>Católica</OPTION>
  3. <OPTION value ="P" <?php if ($valor_de_bdd == 'P') { echo 'selected="selected"'; } ?>>Protestante</OPTION>
  4. <OPTION value ="M" <?php if ($valor_de_bdd == 'M') { echo 'selected="selected"'; } ?>>Mormona</OPTION>
  5. <OPTION value ="O"<?php if ($valor_de_bdd == 'O') { echo 'selected="selected"'; } ?>>Otras</OPTION>
  6. </SELECT ><br><br>

Saludos.

Última edición por GatorV; 28/07/2009 a las 20:35 Razón: corrección