Buongiorno,
Ho un form con due radio button. Quando si clicca su uno di questi - la selezione di un radio button esclude l'altro -, si apre un campo di input. Premendo sul pulsante submit, si ritorna sulla stessa pagina (la 'myPage.html'). Il mio problema è il seguente: non so come fare per tornare sulla mia pagina con il radio button selezionato e il dato nel campo di input dopo aver premuto il pulsante submit. Qualcuno ha un'idea di come potrei procedere? Grazie.
Ciao. pfitzer
P.S.: il mio codice è:
-----------------------------------------------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
<script type="text/javascript">
function checkIt(el) {
var elementsArray = ['1text','2text'];
for (var i=0; i<elementsArray.length; i++) {
sel = document.getElementById(elementsArray[i]);
if (el.value == elementsArray[i]) {
sel.style.display = 'block';
} else {
sel.style.display = 'none';
}
}
}
function submitForm() {
document.myForm.submit();
}
</script>
</script>
<title>radio button tests</title>
</head>
<body>
<form name="myForm" action="myPage.html" method="get" >
<table>
<tr>
<td><input type="radio" name="radioButton" value="1text" onclick="checkIt(this)">first<div id="1text" style="display:none;width:150px" /><input type="text" id="single" size="25" name="1TextReal" /></div>
<td>
</tr>
<tr>
<td><input type="radio" name="radioButton" value="2text" onclick="checkIt(this)">second<div id="2text" style="display:none;width:150px" /><input type="text" id="single" size="25" name="2TextReal" /></div>
</tr>
</tr>
</table>
<input type="submit" value="send me info" onclick="submitForm()">
</form>
</body>
</html>
-----------------------------------------------------------------------------------------