本文介绍了动态创建单选按钮中的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨.....
我想创建一个动态单选按钮并调用button的onblur()函数.
我的代码在下面给出...

Hi.....
I want to create a dynamic radio button and call in onblur() function of button.
My code is given below...

var val=XmlReq.responseText;

            var adr=val.split("$")


            if(adr.length>1)//if employee exist
            {
               var v=val.split('|');

                //document.getElementById('ctl00_ContentPlaceHolder1_txtBillingAddress').value=adr[0];
                 var BillAddress = "<input name='Bill' type='radio'>"+adr[0];
                 document.getElementById("txtBillingAddress").innerHTML=BillAddress

                var ShipAddress = "<input name='rad' type='radio'>"+adr[1];
                 document.getElementById("txtDeliveryAddress").innerHTML=ShipAddress

                document.getElementById('ctl00_ContentPlaceHolder1_txtemail').value=adr[2];

                document.getElementById('ctl00_ContentPlaceHolder1_txtBillingName').value=adr[3];
                document.getElementById('ctl00_ContentPlaceHolder1_txtDeliveryName').value=adr[4];
                document.getElementById('ctl00_ContentPlaceHolder1_txtSalesmanName').value=adr[5];
                document.getElementById('ctl00_ContentPlaceHolder1_txtSalesmanId').value=adr[6];
                var i=0;
                while(i<adr[7].length)
                  {
                    var billAddress=adr[7].split("$")
                    // alert(adr[7]);
                     var BillRadio = "<input name='Bill' type='radio'>"+adr[7];
                     document.getElementById("BillDiv").innerHTML=BillRadio
                     i++;
                  }

                var ii=0;
                while(ii<adr[8].length)
                  {
                     var billAddress=adr[8].split("$")
                    // alert(adr[8]);
                     var ShipRadio = "<input name='rad' type='radio'>"+adr[8];
                     document.getElementById("ShipDiv").innerHTML=ShipRadio
                     ii++;
                  }




拆分字符串时,adr [7]和adr [8]的值没有多个值...




value of adr[7] and adr[8] have not multiple values when we split the string...

推荐答案






分割字符串时,adr [7]和adr [8]的值没有多个值...




value of adr[7] and adr[8] have not multiple values when we split the string...


这篇关于动态创建单选按钮中的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-22 16:14