Originariamente inviato da arnold81
poi nn ti chiedo + nulla
figurati... oggi giornata fiacca al lavoro
Ecco il codice... attento che io non ho la tua ajax.php. Per cui mi sono creato una semplice pagina che mi stampa in uscita un '3'
E poi ho provato solo con FF
codice:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
<meta name="generator" content="PSPad editor, www.pspad.com">
<script language="javascript1.1">
<!--
//funzione quando seleziono il cliente
function trova()
{
g = document.prova.clienti.value;
linkajax('&id_cliente=' + g,'attivita','ajax.php');
}
var isWorking = false;
var wichid;
function linkajax(f,g,h)
{
if (!isWorking && http)
{
http.open("GET", h + "?rand=" + Math.random() + f , true);
wichid=g;
http.onreadystatechange = handleHttpResponse;
isWorking = true;
http.send(null);
}
}
function getHTTPObject()
{
var xmlhttp;
if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
{
try
{
xmlhttp = new XMLHttpRequest();
} catch (e)
{
xmlhttp = false;
}
}
return xmlhttp;
}
var http = getHTTPObject();
function handleHttpResponse()
{
if (http.readyState == 4)
{
alert(http.responseText);
prova.lavoro.selectedIndex = http.responseText;
}
isWorking = false;
}
-->
</script>
<title>
</title>
</head>
<body>
<form name=prova>
<select name=clienti onchange=trova();>
<option value="1">
dsfsd
</option>
<option value="2">
dsfssadfsadd
</option>
</select>
<select name=lavoro id=attivita>
<option value="1"> Opzione 1 </option>
<option value="2"> Opzione 2 </option>
<option value="3"> Opzione 3 </option>
<option value="4"> Opzione 4 </option>
</select>
</form>
</body>
</body>
</html>