Un ejemplo para que adaptes:
Código PHP:
<?php
if(isset($_GET['loquesea']) && ($_GET['loquesea']==1 || $_GET['loquesea']==2) ){
$opciones=array('',array('uno','dos','tres'),array('cuatro','cinco','seis'));
echo implode(',',($opciones[intval($_GET['loquesea'])]));
exit;
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>ejemplo</title>
<script>
function http(){
if(typeof window.XMLHttpRequest!='undefined'){
return new XMLHttpRequest();
}else{
try{
return new ActiveXObject('Microsoft.XMLHTTP');
}catch(e){
alert('Su navegador no soporta AJAX');
return false;
}
}
}
function cambiar(el){
document.getElementById('slave').innerHTML='';
var h=new http;
if(!h)return;
h.open('get','<?php echo basename($_SERVER['PHP_SELF']) ?>?loquesea='+el.value+'&'+(+(new Date())),true);
h.onreadystatechange=function(){
if(h.readyState==4 && h.status == 200){
var r=h.responseText.split(',');
var fragment=document.createDocumentFragment(), tmp;
for(var i=0,l=r.length;i<l;i++){
tmp=document.createElement('option');
tmp.value=tmp.text=r[i];
fragment.appendChild(tmp);
}
document.getElementById('slave').appendChild(fragment);
h.onreadystatechange=function(){}
h.abort();
h=null;
}
}
h.send(null);
}
onload=function(){cambiar(document.getElementById('master'));};
</script>
</head>
<body>
<select name="cantidad" id="master" onchange="cambiar(this)">
<option value="1"> 1 </option>
<option value="2"> 2 </option>
</select>
<select id="slave">
</select>
</body>
</html>