日期:2014-05-16  浏览次数:20293 次

为什么弹出的id不是123456
为什么弹出的不是123456而是13579呢。问题出在那里呢
HTML code


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1"><title>
    用户列表
</title><link href="../../images/skin.css" rel="stylesheet" type="text/css" />
   <style type="text/css">
<!--
a:link {
    text-decoration: none;
}
a:visited {
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
a:active {
    text-decoration: none;
}
-->
</style>
<script type="text/javascript" language="javascript">

  function ChangeChk(ctl)
  {  
  var theBox=ctl;
  var elem=theBox.form.elements;
  var ss = new Array();
  var i;
      for(i=0;i<elem.length;i++)
      {
          if(elem[i].type=='radio')
          {
              if(elem[i].id==theBox.id)
              {
                 elem[i].checked=true;
                 alert(i);
                 if(i<10)
                 {
                    i="0"+i;
                 }
                 ss[0]=document.getElementById("DataList1_ctl"+i+"_TextBox1").value;
                 window.returnValue = ss;
                 //window.close();
              }
             else
              {
                 elem[i].checked=false;
              }
            }
        }
  }
  </script>

</head>
<body>
    <form name="form1" method="post" action="user.aspx" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTExNzk2ODAzMDcPZBYCAgMPZBYCAgEPPCsACQEADxYEHghEYXRhS2V5cxYAHgtfIUl0ZW1Db3VudAIGZGQYAQUeX19Db250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgwFE0RhdGFMaXN0MSRjdGwwMCRDaGsFE0RhdGFMaXN0MSRjdGwwMCRDaGsFE0RhdGFMaXN0MSRjdGwwMSRDaGsFE0RhdGFMaXN0MSRjdGwwMSRDaGsFE0RhdGFMaXN0MSRjdGwwMiRDaGsFE0RhdGFMaXN0MSRjdGwwMiRDaGsFE0RhdGFMaXN0MSRjdGwwMyRDaGsFE0RhdGFMaXN0MSRjdGwwMyRDaGsFE0RhdGFMaXN0MSRjdGwwNCRDaGsFE0RhdGFMaXN0MSRjdGwwNCRDaGsFE0RhdGFMaXN0MSRjdGwwNSRDaGsFE0RhdGFMaXN0MSRjdGwwNSRDaGtfWgRX0iDsC1gnqXrFXW7p0RIJ6A==" />
</div>

    <div>
      <table width="100%" border="1" cellpadding="1" cellspacing="1" bordercolor="#D5E2F2">
 <tr>
    <td width="100%" height="30" bgcolor="#D5E2F2">
        <span style="font-weight: bold; color: #0099FF; font-size: 20px;">用户列表</span></td>
  </tr
  ><tr>
    <td height="22">
        <table id="DataList1" cellspacing="0" border="0" style="width:100%;border-collapse:collapse;">
    <tr>
        <td>
                <table width="100%" border="1" cellpadding="1" cellspacing="1" bordercolor="#D5E2F2">
 <tr>
    <td width="50%" height="22" align="center">
        <input id="DataList1_ctl00_Chk" type="radio" name="DataList1$ctl00$Chk" value="Chk" onclick="ChangeChk(this);" />
        <input name="DataList1$ctl00$TextBox1" type="text" value="admin" id="DataList1_ctl00_TextBox1" />
    </td>
  </tr>
</table>
                
            </td>
    </tr><tr>
        <td>
                <table width="100%" border="1" cellpadding="1" cellspacing="1" bordercolor="#D5E2F2">
 <tr>
    <td width="50%&