As the title suggests, I'm trying to get certain forms to show depending on which Radio button is selected.
I'm attempting to base it of this..
Code:
<html>
<head>
<script>
function RadioGroup1_toggle(c)
{
if (c.value == 'yes')
document.getElementById('hideme').style.visibility='visible';
else
document.getElementById('hideme').style.visibility='hidden';
}
</script>
</head>
<body>
<table width="551" border="0" cellpadding="5" cellspacing="0">
<tr>
<th valign="top"><div align="left">label1</div></th>
<td>
<input name="RadioGroup1" type="radio" id="yes" onClick="RadioGroup1_toggle(this);" value="yes" />
<label>Yes</label>
<input name="RadioGroup1" type="radio" id="no" onClick="RadioGroup1_toggle(this);" value="no" checked />
<label>No</label>
</td>
</tr>
<tr id="hideme" style="visibility:hidden;">
<th valign="top">label2:</th>
<td><input name="text2" type="text" id="text2" size="50" /></td>
</tr>
</table>
</body>
</html>
But can't get past only have two options.
Using this...
Code:
<html>
<body>
<form action="insert.php" method="post">
First name: <input type="text" name="FName" />
<br>
Last name: <input type="text" name="LName" />
<br>
Username: <input type="text" name="UName" />
<br>
Student ID: <input type="text" name="StuID" />
<br>
Category:
<br>
<input type="radio" name=Cat value="School" >School
<br>
<input type="radio" name=Cat value="Facebook">Facebook
<br>
<input type="radio" name=Cat value="MySpace">MySpace
<br>
<input type="radio" name=Cat value="Other">Other
<br>
<input type="submit" value="Update Database" />
</form>
</body>
</html>
I'm trying to make it so if "School" is selected, then it shows the "FName" "LName" "UName" and StuID" forms, and if Facebook or MySpace is selected to show "FName" "LName" "UName" "PWord" "E-Mail".
Anyone?
Bookmarks