<form action = "#" method = "post" id = "mioForm">
<table style="width:100%">
<tr>
<td></td>
<td><input type="hidden" name="id1" size="20" value="<? echo $id1; ?>">
</td>
</tr>
<tr>
<td></td>
<td><input type="hidden" name="id" size="20" value="<? echo $id; ?>">
</td>
</tr>
<tr>
<td>Data: </td>
<td><input type="date" name="data"
value="<?php
echo date("d/m/20y", time ());
?>"> </td>
</tr>
<tr></tr>
<tr>
<td>Durata (settimane): </td>
<td>
<select size="1" name="settimane">
<?php for($io=1; $io<=20; $io++){ echo "<option value=\"$io\">".$io."</option>";} ?>
</select>
</td>
</tr>
<tr></tr>
<tr>
<td>Livello: </td>
<td>
<select size="1" name="livello">
<option value="">Seleziona</option>
<option value="base">Base</option>
<option value="intermedio">Intermedio</option>
<option value="avanzato">Avanzato</option>
</select>
</td>
</tr>
<tr></tr>
<tr>
<td>Obiettivo: </td>
<td>
<select size="1" name="obiettivo">
<option value="">Seleziona</option>
<option value="dimagrimento">Dimagrimento</option>
<option value="massa">Massa</option>
<option value="tonificazione">Tonificazione</option>
<option value="definizione">Definizione</option>
<option value="definizione">Schede precompilate sugli obiettivi</option>
</select>
</td>
</tr>
<tr>
<td>Scegliere tipo di Scheda: </td>
<td>
<input type = radio name="rispo" onClick = "cambiaAction('inserimento_dati.php')">inseris ci dati in una nuova scheda
<input type = radio name= "rispo" onClick = "cambiaAction('index.php')">Visualizza schede precompilate </td>
</table>
<hr />
<br /><br />
<input type="submit" name="submit" value="Inserisci">
</form>
<script>
function cambiaAction(act) { document.getElementById('mioForm').action = act; }
</script>