使用style.display =" none"时使用IE 8的问题通过JS在两个潜在标签之一

时间:2012-03-23 06:35:40

标签: javascript html internet-explorer displaytag

因为整体块很大,所以让我在前面加上实际的网址,这样我的所有代码/ html都可用http://csufpsychandlaw.zxq.net/JurorSurvey.html

主要问题似乎是到目前为止在第90-117行,对应于553/554,其中IE8停止运行脚本。没有其他浏览器我尝试过这个问题(FF,Opera和Chrome都运行良好)

我想要发生的是 - 页面打开到第一个问题块,当点击下一个按钮时,div会隐藏并弹出下一组问题。然而,在这个集合中有两个问题(ctrl -f culp11 + culp13来找到它们),这些问题根据用户读取的情况(记录在cookie上)而具有不同的提示。然而,在我遇到IE的多台计算机上(我相信所有的都是IE8 +但需要在校园里验证)停止问题culp11(我的计算机显示两个版本的提示,这意味着它在某种程度上忽略了隐藏的命令不相关的提示)。这意味着最后几个问题以及在IE中继续使用的能力都缺失了。

据我所知,这是违规的部分,这个页面相当大,所以我只复制了一些。

JS

function EnterVerd()
{
    //hide previous section
    document.getElementById("ABInstruct").style.display="none";
    document.getElementById("CDInstruct").style.display="none";
    document.getElementById("VerdictBlurb").style.display="none";
    document.getElementById("VerdictRadio").style.display="none";
    document.getElementById("SentBlurbAB").style.display="none";
    document.getElementById("SentBlurbCD").style.display="none";
    document.getElementById("SentRadio").style.display="none";
    document.getElementById("VerdBtn").style.display="none";

    //show next section
    document.getElementById("JurOpForm").style.display="inline";
    document.getElementById("JOFbtn").style.display="inline";

    //hides the non-corresponding prompt for some of the JOF questions.
    var scenario = getCookie("SceneIt");

    if (scenario!=null && scenario!="")
    {
        if (scenario == "scene1")
        {
            document.getElementById("CDCulp11label").style.display="none";
            document.getElementById("CDCulp13label").style.display="none";
        }
        else if (scenario == "scene2")
        {
            document.getElementById("CDCulp11label").style.display="none";
            document.getElementById("CDCulp13label").style.display="none";
        }
        else if (scenario == "scene3")
        {
            document.getElementById("ABCulp11label").style.display="none";
            document.getElementById("ABCulp13label").style.display="none";
        }  
        else
        {
            document.getElementById("ABCulp11label").style.display="none";
            document.getElementById("ABCulp13label").style.display="none";
        }  
    }
    else
    {
        document.getElementById("ABCulp11label").style.display="none";
        document.getElementById("ABCulp13label").style.display="none";
    }
}

HTML

<p>
    <table>
    <tr><th colspan=12><input type="radio" name="13Culp11" value="" checked="checked"         style="display:none;"/> 
        <label for = "13Culp11" id = "CDCulp11label">If you found the defendant guilty, to what degree do you think the defendant intentionally meant to steal from his employer?</th></tr>
        <label for = "13Culp11" id = "ABCulp11label">If you found the defendant guilty, to what degree do you think the defendant intentionally meant to assault the victim?</th></tr>
    <tr>    
        <td class = "sampleform"><input type="radio" name="13Culp11" id="1" value="1"/></td>
        <td class = "sampleform"><input type="radio" name="13Culp11" id="2" value="2"/></td>
        <td class = "sampleform"><input type="radio" name="13Culp11" id="3" value="3"/></td>
        <td class = "sampleform"><input type="radio" name="13Culp11" id="4" value="4"/></td>
        <td class = "sampleform"><input type="radio" name="13Culp11" id="5" value="5"/></td>
        <td class = "sampleform"><input type="radio" name="13Culp11" id="6" value="6"/></td>
        <td class = "sampleform"><input type="radio" name="13Culp11" id="7" value="7"/></td>
    </tr>
    <tr>
        <td class = "sampleform"><label for="1">No intention</label></td>
        <td class = "sampleform"><label for="2"></label></td>
        <td class = "sampleform"><label for="3"></label></td>
        <td class = "sampleform"><label for="4"></label></td>
        <td class = "sampleform"><label for="5"></label></td>
        <td class = "sampleform"><label for="6"></label></td>
        <td class = "sampleform"><label for="7">Full intention</label></td>
    </p>
    </table>
</p>

0 个答案:

没有答案