hello
i have problem with radio in this code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="style.css" rel="stylesheet" />
<script>
function add()
{
var radio=document.getElementsByName("t");
var d=document.getElementById("div");
if(radio[0].checked==true)
{
d.innerHTML+="<p><input type='text' id='txtfname'><br />";
d.innerHTML+="<p><input type='text' id='txttxtlname'><br />";
d.innerHTML+="<p><input type='submit' value="">";
}
if(radio[1].checked==true)
{
d.innerHTML+="<p><input type='text' id='code'><br />";
d.innerHTML+="<p><input type='submit' value="">";
}
}
</script>
</head>
<body>
<form method="post" >
<table >
<tr>
<input type="radio" id="name" name="t" value="name" /></td><td> </td><td>
<input type="radio" id="code" name="t" value="code" /></td><td></td></tr>
<tr>
<td><p><input type="button" value="Add" onclick="add()" class="btn"/></p></td></tr>
<tr><td>
<div id="div">
</td>
</tr>
</div>
</table>
</form>
</body>
</html>