ho modificato qualcosa ma non va lo stessoCodice PHP:<html>
<head>
<script type="text/javascript" >
function Rubrica (p,n) {
x=p.value;
y=n.value;
document.write(x + y);
nomi = new Array ();
numeri = new Array ();
this.inserisci = function (x,y)
{
this.nomi[this.nomi.length] = x;
window.alert(this.nomi[this.nomi.length]);
this.numeri[this.numeri.length] = y;
}
this.cerca = function (p)
{
for (var i = 0; i<= this.nomi.length; i++){
if (this.nomi[i] == p)
window.alert ("Nome"+this.nomi[i], +"Numero"+ this.numeri[i]);
}
}
}
</script>
<title></title>
</head>
<body>
<form name="s" >
<input type="text" name="p">Nome
<input type="text" name="n">Numero
<input type="button" value="prova" onclick="
Rubrica(p,n);
"/>
</form>
</body>
</html>

Rispondi quotando