this code works well for the i.e but its not working in firefox . and also i want to do validations
only if theatre is selected , but, this is validating for the museum also .
only if theatre is selected , but, this is validating for the museum also .
Code:
code <html>
<head>
<script type="text/javascript">
function check()
{
if(document.fm.ra[0].checked == true && document.fm.ra[0].value == "Theatre")
{
fm.text1.style.display = "block";
fm.sel1.style.display = "block";
fm.sel2.style.display = "block";
}
else if(document.fm.ra[1].checked == true && document.fm.ra[1].value == "Musuem")
{
fm.text1.style.display = "none";
fm.sel1.style.display = "none";
fm.sel2.style.display = "none";
}
}
</script>
</head>
<body>
<form name="fm">
<input type="radio" name="ra" value="Theatre" onclick="check();"/>Theatre
<input type="radio" name="ra" value="Musuem" onclick="check();" />Musuem
<br>
<asp:RequiredFieldValidator visible="" ID="RequiredFieldValidator1"
runat="server" ErrorMessage="*" ControlToValidate="text1"></asp:RequiredFieldValidator><input type="text" id="text1" runat="server" name="text1" /><br>
<select name="sel1">
<option value="test">1</option>
</select><br>
<select name="sel2">
<option value="test">2</option>
</select>
</form>
</body>
</html>
Comment