在单击单选按钮时,即在div中打开div,但在firefox中无法打开 [英] on click radio button open div in ie but not open in firefox

查看:72
本文介绍了在单击单选按钮时,即在div中打开div,但在firefox中无法打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在其上有一个单选按钮,它可以打开一个div,它在IE中效果很好,但在firefox中无法打开
这是它的代码


< input type ="radio" runat ="server" id ="optWarrantyVoid" groupname ="WarrantyVoid"
onclick ="Javascript:ShowDiv(''Yes'')"/>
这是Java脚本


i have a radio button on check it open a div it work nice in IE but not open in firefox
here is code for it


<input type="radio" runat="server" id="optWarrantyVoid" groupname="WarrantyVoid"
onclick="Javascript:ShowDiv(''Yes'')" />
here is java script


function ShowDiv(action) {
           alert("1")
           var action1=action
           document.getElementById(divMsg).innerHTML = "";
           if (action1 == "Yes") {
               alert("2")
               document.getElementById("<%=VoidReason.ClientID%>").style.display = "block";
               document.getElementById("<%=lnkCreateEstimate.ClientID%>").style.display = "block";
               document.getElementById("<%=lnkOrderParts.ClientID%>").style.display = "none";

               //              Work Done is Invisible when Warranty Void = Yes"-------------------------------------------------------------------------------------------------------------------------
               document.getElementById("<%=divbtnQC.ClientID%>").style.display = "none";
               document.getElementById("<%=divActions.ClientID%>").style.display = "none";
               document.getElementById("<%=pnlActionDetails.ClientID%>").style.display = "none";
           }
           else if (action1 == "No") {
           alert("3")
               document.getElementById("<%=VoidReason.ClientID%>").style.display = "none";
               document.getElementById("<%=lnkCreateEstimate.ClientID%>").style.display = "none";
               document.getElementById("<%=lnkOrderParts.ClientID%>").style.display = "block";
               document.getElementById("<%=ddlReasonWarrantyVoid.ClientID%>").selectedIndex = 0;
               //              Work Done is Visible when Warranty Void = No"-------------------------------------------------------------------------------------------------------------------------
               document.getElementById("<%=divbtnQC.ClientID%>").style.display = "block";
               document.getElementById("<%=divActions.ClientID%>").style.display = "block";
               document.getElementById("<%=pnlActionDetails.ClientID%>").style.display = "block";
           }
       }

推荐答案

答案总是,请修复您的JavaScript.总是有问题,但值得庆幸的是,FF有firebug,因此您可以调试代码.
The answer is always, fix your javascript. There are always issues, but thankfully, FF has firebug so you can debug your code.


这篇关于在单击单选按钮时,即在div中打开div,但在firefox中无法打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆