trsands
01-06-2004, 01:06 PM
This script gives always gives an oujtput of 'undefined' got the radiobutton values.. can anyone see why?
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
function showgame()
{
var frm = document.forms['form1'];
frm.textfield.value = frm.RG1.value;
}
</script>
</head>
<body>
<p> </p>
<form name="form1" method="post" action="">
<p> </p>
<p>
<label></label>
</p>
<p>
<label>
<input type="radio" name="RG1" value="D">
DTC</label>
Input
<input type="text" name="textfield">
<br>
<label>
<input type="radio" name="RG1" value="M">
MIA</label>
<br>
<label>
<input type="radio" name="RG1" value="L">
LNC</label>
</p>
<p>
<input type="Button" name="Button" value="Button" onClick="showgame()">
</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</form>
<p>
<label></label>
</p>
<p>
<label></label>
<br>
</p>
<p> </p>
</body>
</html>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
function showgame()
{
var frm = document.forms['form1'];
frm.textfield.value = frm.RG1.value;
}
</script>
</head>
<body>
<p> </p>
<form name="form1" method="post" action="">
<p> </p>
<p>
<label></label>
</p>
<p>
<label>
<input type="radio" name="RG1" value="D">
DTC</label>
Input
<input type="text" name="textfield">
<br>
<label>
<input type="radio" name="RG1" value="M">
MIA</label>
<br>
<label>
<input type="radio" name="RG1" value="L">
LNC</label>
</p>
<p>
<input type="Button" name="Button" value="Button" onClick="showgame()">
</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</form>
<p>
<label></label>
</p>
<p>
<label></label>
<br>
</p>
<p> </p>
</body>
</html>