Código PHP:
function Enviar(cate){
var
ajax;
ajax = ajaxFunction();
categ=cate.options[cate.selectedIndex].value
alert('entra'+categ);
switch (categ)
{ case "1":
ajax.open("POST","factura.php", true);
ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
break;
case "2":
ajax.open("POST","albaran.php", true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
break;
}
ajax.onreadystatechange = function()
{
if (ajax.readyState == 4)
{
document.getElementById('contenido').innerHTML =
ajax.responseText;
}}
ajax.send(null);
}
</script>
Código PHP:
<select name="tipo" id="tipo">
<option value="A">Factura</option>
<option value="B">Albaran</option>
</select>