Javascript 如何从广播组中删除Spry验证?

Javascript 如何从广播组中删除Spry验证?,javascript,spry,Javascript,Spry,我知道如何销毁文本字段的验证,但当我对单选按钮组应用相同的逻辑时,Spry验证不会销毁 在下面的示例中,您会看到单选按钮,如果用户选择的不是个人,我将尝试销毁验证 <script> var spryradio1; function checkData(){ // get the value document.getElementById("spryradio1").style.display = "none"; var value = document.ap

我知道如何销毁文本字段的验证,但当我对单选按钮组应用相同的逻辑时,Spry验证不会销毁

在下面的示例中,您会看到单选按钮,如果用户选择的不是个人,我将尝试销毁验证

<script>
var spryradio1;

function checkData(){
    // get the value
    document.getElementById("spryradio1").style.display = "none";
    var value = document.applicationform.type.options[document.applicationform.type.options.selectedIndex].value;
    if(value !=""){
    if(value == "Individual"){

        if(!spryradio1){
        spryradio1 = new Spry.Widget.ValidationRadio("spryradio1");
        }

        document.getElementById("spryradio1").style.display = "block";

    } else {


        // if there is a validaiton in sprytextfield destory it, and clear the variable

        if(spryradio1 && spryradio1.destroy){
            spryradio1.resetClasses();
            spryradio1.destroy();
            spryradio1 = null;
            }

        document.getElementById("spryradio1").style.display = "none";
    }
    // proceed with the rest as normal
    }
    return true;
};
</script>

spryradio1变种;
函数checkData(){
//获取值
document.getElementById(“spryradio1”).style.display=“无”;
var value=document.applicationform.type.options[document.applicationform.type.options.selectedIndex].value;
如果(值!=“”){
如果(值=“个人”){
如果(!spryradio1){
spryradio1=新的Spry.Widget.ValidationRadio(“spryradio1”);
}
document.getElementById(“spryradio1”).style.display=“block”;
}否则{
//如果sprytextfield中有validaiton,请销毁它,并清除该变量
如果(spryradio1和&spryradio1.销毁){
spryradio1.resetClasses();
spryradio1.destroy();
spryradio1=null;
}
document.getElementById(“spryradio1”).style.display=“无”;
}
//其余的照常进行
}
返回true;
};

单选按钮不喜欢resetClasses行;当我将行更改为:

if(spryradio1)
{ spryradio1.reset();
spryradio1.destroy();
spryradio1 = null; }

请用适当的语言标记你的问题。大概是
javascript
<另一方面,代码>验证,并不是一个有用的标记。感谢您的帮助。我是一个新的发布者(但是已经使用了很多这个资源)。我还回答了我自己的问题:如果(spryradio1){spryradio1.reset();spryradio1.destroy();spryradio1=null;}如果找到了答案,请将其作为一个发布!