文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>在ascx页面使用js获取radiobuttonlist的值

在ascx页面使用js获取radiobuttonlist的值

时间:2011-04-11  来源:chenran

  function GetInputValue()
    {
        var TBBidPrice=document.getElementById("<%=TBBidPrice.ClientID %>").value;
        return TBBidPrice;
    }
    function GetRadio(tagname)
    { 
        var input =document.getElementsByTagName("input");//获取所有input标签
        for(var i=0;i<input.length;i++)
        {
            //判断是否是radio
            if(input[i].type=="radio")
            {
                //如果tag名称相同 则找到对应的radio标签
                if(input[i].name.indexOf(tagname)>0)
                {               
                   //获取radiobuttonList标签 
                   radio =document.getElementsByName(input[i].name);
                   for(var j=0;j<radio.length;j++)
                   {
                     if(radio[j].checked==true)
                     {
                        //寻找radio里的下一个标签
                        var nextEle = radio[j].nextSibling;
                        //判断找到label标签
                        if(nextEle.tagName.toLowerCase() == "label")
                         {
                            //获取值label的值
                            var Label = nextEle.innerText;
                            var hetongjia = GetInputValue();
                            var laobaofei;
                            if(hetongjia!=null&& hetongjia!="")
                            { 
                                if(Label!="其他")
                                {
                                        laobaofei = parseFloat(Label)*parseFloat(hetongjia)*parseFloat(0.01);
                                        document.getElementById("<%=TBJiGouAllCost.ClientID %>").value=laobaofei.toFixed(2);
                                } 
                                else
                                 {
                                        var otherValue = document.getElementById("<%=TBOtherTongChouRate.ClientID %>").value;
                                       
                                        if(otherValue != null && otherValue != ""){
                                           var hetongtemp = GetInputValue();
                                           laobaofei = parseFloat(otherValue)*parseFloat(hetongtemp)*parseFloat(0.01);
                                           document.getElementById("<%=TBJiGouAllCost.ClientID %>").value=laobaofei.toFixed(2);
                                        }else{
                                            alert("请输入劳保费率");
                                        }
                                   } 
                              } 
                           
                          }
                       }
                   }
                   return;
                }
            }
        }
    } 

相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载