1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| <!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><br><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><br></tr>
</tr>
</table>
<input type="submit" value="send me info" onclick="submitForm()">
</form>
</body>
</html> |
Partager