单选按钮列表的Javascript [英] Javascript for radiobuttonlist

查看:61
本文介绍了单选按钮列表的Javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何编写以下代码的Javascript?

How to write Javascript For following code?

if (((rbShapeList.SelectedIndex == 0) || (rbShapeList.SelectedIndex == 1)) && rblistColor.SelectedIndex == 1)     ctl00_ContentPlaceHolder1_DxPanel1_rbShapeList	  ctl00_ContentPlaceHolder1_DxPanel3_rblistColor
            {
                PanShape.Visible = false;
                rbShapeList.RepeatDirection = RepeatDirection.Vertical;
                rbShapeList.Height = 66;

                PanFancyShape.Height = 134;

                PanCut.Enabled = true;
            }

推荐答案

函数SelectedRdValue(theField)
{
if(theField == null){返回true; }

for(i = 0; i< theField.length; i ++)
{
if(!theField [i] .disabled)
{
如果(theField [i] .checked)
{
//flag = true;
返回theField [i] .value;
}

}
}
返回null;
}

呼叫DisableMpDmLoad()任何事件



函数DisableMpDmLoad()
{
var Form = document.frmCJApplication;


var theField = Form.rdoCategory;
if(SelectedRdValue(Form.rdoDomecile)=="N")
{

for(i = 0; i< theField.length; ++ i)
{
//flag = true;
if(theField [i] .value ="UR")
{
theField [i] .checked = true;
document.getElementById(''rdoCategory'').disabled = true;
}
}


}

}
function SelectedRdValue(theField)
{
if(theField==null){ return true; }

for (i = 0; i < theField.length; i++)
{
if(!theField[i].disabled)
{
if (theField[i].checked)
{
//flag= true;
return theField[i].value;
}

}
}
return null;
}

Call DisableMpDmLoad()any event



function DisableMpDmLoad()
{
var Form=document.frmCJApplication;


var theField=Form.rdoCategory ;
if(SelectedRdValue(Form.rdoDomecile)=="N")
{

for (i = 0; i < theField.length; ++i)
{
//flag= true;
if(theField[i].value="UR")
{
theField[i].checked=true;
document.getElementById(''rdoCategory'').disabled=true;
}
}


}

}


这篇关于单选按钮列表的Javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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