<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<script>
function svjazannoe_pole(v){
var el = document.getElementById('prijom_do');
while(el.childNodes.length>0){el.removeChild(el.childNodes[el.childNodes.length-1]);}
v=+v+1;
for(var i=v;i<25;i++){
var opt = document.createElement("option");
opt.innerHTML= i;
el.appendChild(opt);
}
var el = document.getElementById('otpravka_ot');
while(el.childNodes.length>0){el.removeChild(el.childNodes[el.childNodes.length-1]);}
for(var i=0;i<v;i++){
var opt = document.createElement("option");
opt.innerHTML= i;
el.appendChild(opt);
}
var el = document.getElementById('otpravka_do');
while(el.childNodes.length>0){el.removeChild(el.childNodes[el.childNodes.length-1]);}
}
function svjazannoe_pole2(v){
var el = document.getElementById('otpravka_do');
while(el.childNodes.length>0){el.removeChild(el.childNodes[el.childNodes.length-1]);}
v=+v+1;
var e = document.getElementById("prijom_ot");
var p = +e.options[e.selectedIndex].value + 1;
for(var i=v; i < p; i++){
var opt = document.createElement("option");
opt.innerHTML= i;
el.appendChild(opt);
}
}
</script>
</head>
<body>
<form>
<select name="prijom_ot" id="prijom_ot" onchange="svjazannoe_pole(this.value)">
<option value=13>13</option>
<option value=14>14</option>
<option value=15>15</option>
<option value=16>16</option>
<option value=17>17</option>
</select>
<select id="prijom_do" name="prijom_do">
</select>
<select id="otpravka_ot" name="otpravka_ot" onchange="svjazannoe_pole2(this.value)">
</select>
<select id="otpravka_do" name="otpravka_do">
</select>
<input type="submit" value="Send">
</form>
</body>
</html>