Ver Mensaje Individual
  #21 (permalink)  
Antiguo 08/01/2014, 15:12
andre___5025
 
Fecha de Ingreso: septiembre-2013
Ubicación: Bogota
Mensajes: 139
Antigüedad: 10 años, 7 meses
Puntos: 0
Respuesta: Combos Dependientes Repetidos

Mira puedes utilizar este ejmplo. Se puede modificar a los requerimientos que estas nacesitando


<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta title="habilitar, deshabilitar combos según selección en otro combo">

<script>
function habilitar(value)
{
if(value=="1" || value==true)
{
// habilitamos
document.getElementById("segundo").disabled=false;
}else if(value=="2" || value==false){
// deshabilitamos
document.getElementById("segundo").disabled=true;
}
}
</script>
</head>

<body>
<form>
<h1>habilitar, deshabilitar combos según selección en otro combo</h1>
<div>
Primer select:<select name="primero" id="primero" onchange="habilitar(this.value);">
<option value='0'>selecciona</option>
<option value='1'>habilitar el segundo</option>
<option value='2'>deshabilitar el segundo</option>
</select>
</div>
<div>
segundo select:<select name="segundo" id="segundo">
<option value='1'>seleccion 1</option>
<option value='2'>seleccion 2</option>
</select>
</div>
</form>
</body>
</html>