In FireFox , the below code s not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sureshl
    New Member
    • Jan 2009
    • 23

    In FireFox , the below code s not working

    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 .
    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>
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    What exactly are you trying to do? hide and unhide? That's done with the Visibility style element, not display

    Comment

    Working...