Ver Mensaje Individual
  #2 (permalink)  
Antiguo 18/01/2011, 22:40
resu
 
Fecha de Ingreso: mayo-2006
Ubicación: Argentina (Buenos Aires,CABALLITO)
Mensajes: 331
Antigüedad: 18 años
Puntos: 9
Respuesta: atributo rel en option value de un select

Cita:
Iniciado por Prais Ver Mensaje
hola, no puedo solucionar este detalle, lo peor que segun ejemplos visto estan bien asignadas las "", a ver mando dos id a un select asi:
Código PHP:
Ver original
  1. $id_cliente=$_REQUEST['id_cliente'];?>
  2. <select name="Select2" id="Select2" align="middle" onChange="Obra(this.value)" style="font-size:11px;color:#000000;font-family:Arial;border:1px solid #CCCCCC">
  3. <option value="" selected="selected">[Seleccione]</option>
  4. <?php $SqlQuery=mysql_query("select ID_OBRA,DE_NOMBRE from lk_lug_obra  where ID_CLIENTE='$id_cliente' order by DE_NOMBRE asc",$cn);
  5. while ($AccesaRegP=mysql_fetch_array($SqlQuery))
  6. { ?>
  7. <option value="<?php echo $AccesaRegP['ID_OBRA']?>"rel="<?php echo $id_cliente ?>"><?php echo htmlentities($AccesaRegP['DE_NOMBRE']) ?></option>
  8.     <?php }?>
  9. </select>
y una funcion me captura los dos id, el punto es que si recoje el id_obra y no me reconoce el rel, y lo muestra como undefined. habra otra forma de asignar el id_cliente al rel- ??????.-
Código PHP:
Ver original
  1. $id_cliente=$_REQUEST['id_cliente'];?>
  2. <select name="Select2" id="Select2" align="middle"  onChange="Obra(this.value)"  style="font-size:11px;color:#000000;font-family:Arial;border:1px solid  #CCCCCC">
  3. <option value="" selected="selected">[Seleccione]</option>
  4. <?php $SqlQuery=mysql_query("select ID_OBRA,DE_NOMBRE from  lk_lug_obra  where ID_CLIENTE='$id_cliente' order by DE_NOMBRE  asc",$cn);
  5. while ($AccesaRegP=mysql_fetch_array($SqlQuery))
  6. { ?>
  7. <option value="<?php echo  $AccesaRegP['ID_OBRA']?>"rel="<?php echo  $AccesaRegP['ID_CLIENTE']?>"><?php echo htmlentities($AccesaRegP['DE_NOMBRE'])  ?></option>
  8.     <?php }?>
  9. </select>

igual es raro que no te lo tome desde el modo que pusiste, estas seguro que esta recibiendo el $_REQUEST['id_cliente'] como variable?