Ver Mensaje Individual
  #4 (permalink)  
Antiguo 20/04/2006, 11:46
ivomat
 
Fecha de Ingreso: abril-2005
Ubicación: colombia
Mensajes: 242
Antigüedad: 19 años
Puntos: 0
<script>
function cargaPlan(){
var i; var i=0; var tam,x; tam=0;
var mis_planes= new Array(); var num_planes;
num_dptos=0;
<?php
$sql=mysql_query("select idplan from tb_plan where clinit = '$f_clinit' ");
while ($roww=mysql_fetch_array($sql)){?>
mis_planes[tam]='<?echo $roww['idPlan'];?>'
tam++;
<?php } ?>
num_planes=mis_planes.length;
if (num_planes>0){
document.forma_adicionar_beneficiario.f_benplan.le ngth = num_planes;
for(i=0;i<num_planes;i++){
document.forma_adicionar_beneficiario.f_benplan.op tions[i].value=mis_planes[i]
document.forma_adicionar_beneficiario.f_benplan.op tions[i].text=mis_planes[i]
}
}else{
document.forma_adicionar_beneficiario.f_benplan.le ngth = 1
document.forma_adicionar_beneficiario.f_benplan.op tions[0].value = "-"
document.forma_adicionar_beneficiario.f_benplan.op tions[0].text = "-"
}
}

Y LA LLAMO ACA
<SELECT NAME="f_clinit" class="campos" onchange="cargaPlan()">
<option value = "0">Seleccionar</option>
<?
$query_con = "SELECT clinit,razon_social FROM tb_convenio ORDER BY razon_social";
$result_con = mysql_query($query_con);
............................................

PERO NO me funciona la condicion del select no saca los valores siempre me saca son las lines " - " por defecto.

si alguien puede ayudarme en este error.
gracias
__________________
:aplauso: Ivomat