algo asi ?
no entiendo la ultima frase:
Cita: como puedo hacer para que si el usuario elige por ejemplo "5", en el segundo select los campos de options solo lleguen hasta 10
debería ser 5 ?? o 10 ?
Código HTML:
Ver original<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <script type="text/javascript"> function onChangeSelect(select) {
var segundoSelect = document.getElementById("segundo-select");
segundoSelect.options.length = 0;
var total = parseInt(select.value);
for (var i= 1; i <= total ; i++) {
var option = new Option(i, i);
segundoSelect.options.add(option);
}
}
<select onchange="javascript:onChangeSelect(this);">