Ciao ragazzi! Ho un piccolo problema con uno script per avviare una funzione tra form diversi, però non capisco dove sbaglio
:book:
PHP:
<html>
<head>
<script type="text/javascript" language="javascript">
function prova(mioForm)
{
alert(document.forms[mioForm].animale.value);
}
</script>
</head>
<body>
<form name="form1">
<select name="animale">
<option value="gatto">Gatto</option>
<option value="cane">Cane</option>
</select>
<input type="button" value="bottone1" onclick="prova(form1);">
</form>
<form name="form2">
<select name="animale">
<option value="serpente">Serpente</option>
<option value="lucertola">Lucertola</option>
</select>
<input type="button" value="bottone2" onclick="prova(form2);">
</form>
</body>
</html>