上面的是客户端源文件中显示的内容。下面的是在javascript中可以得到的数据-》Row.cells[3].innerHTML

解决方案 »

  1.   

    读取name为GridWDZL:_ctl3:_ctl0的文本框的值:
    function get()
    {
    var s=document.getElementsByName ('GridWDZL:_ctl3:_ctl0')[0];
    if(s==null||typeof(s)=='undefined')
    {
      alert('找不到元素');
    }
    else
    {
      alert(s.value)
    }
    }
      

  2.   

    to vivianfdlpw() 
    document.getElementsByName ('GridWDZL:_ctl3:_ctl0')[0]的值为undefined
    在document.getElementsByName ('GridWDZL:_ctl3:_ctl0').outerHTML中有我要的value值
      

  3.   

    太多了
    <TD id="TDGridWDZL" valign="top" width="100%" colspan="8" height="100%"><table cellspacing="0" rules="all" border="1" id="GridWDZL" style="height:200px;width:100%;border-collapse:collapse;position:none;WORD-BREAK:break-all;WORD-WRAP:break-word;TABLE-LAYOUT:fixed;"><thead>
    <tr class="tablehead" style="height:22px;">
    <td onmousemove="DG_moveOnTH(this)" onmousedown="DG_downOnTH(this)" onmouseup="this.mouseDown=false" onmouseout="this.mouseDown=false" style="width:10%;">序号</td><td onmousemove="DG_moveOnTH(this)" onmousedown="DG_downOnTH(this)" onmouseup="this.mouseDown=false" onmouseout="this.mouseDown=false" style="width:0px;">BZGXWDID</td><td onmousemove="DG_moveOnTH(this)" onmousedown="DG_downOnTH(this)" onmouseup="this.mouseDown=false" onmouseout="this.mouseDown=false" style="width:0px;">BZJXGXID</td><td onmousemove="DG_moveOnTH(this)" onmousedown="DG_downOnTH(this)" onmouseup="this.mouseDown=false" onmouseout="this.mouseDown=false" style="width:40%;">文档名称</td><td onmousemove="DG_moveOnTH(this)" onmousedown="DG_downOnTH(this)" onmouseup="this.mouseDown=false" onmouseout="this.mouseDown=false" style="width:20%;">文档类型</td><td onmousemove="DG_moveOnTH(this)" onmousedown="DG_downOnTH(this)" onmouseup="this.mouseDown=false" onmouseout="this.mouseDown=false" style="width:10%;">编写人</td><td onmousemove="DG_moveOnTH(this)" onmousedown="DG_downOnTH(this)" onmouseup="this.mouseDown=false" onmouseout="this.mouseDown=false" style="width:20%;">提交时间</td>
    </tr></thead><tbody><tr class="tablebody" onclick="javascript:return select(this,'0','WDZL');" ondblclick="__doPostBack('GridWDZL:_ctl3','Edit')" style="height:22px;">
    =====================================这里了= <td>1</td><td>cbcdd896fc854c2494110c1814aced2b</td><td>25023C58BCA04DC9AA2D8B06AB59D165</td><td><input name="GridWDZL:_ctl3:_ctl0" type="text" style="background-color:PowderBlue;border-style:None;width:100%;" /></td><td>image/pjpeg</td><td><input name="GridWDZL:_ctl3:_ctl1" type="text" style="background-color:PowderBlue;border-style:None;width:100%;" /></td><td><input name="GridWDZL:_ctl3:_ctl2" type="text" value="2005-2-14 0:00:00" onclick="setday(this,this,'yyyy-mm-dd')" style="background-color:PowderBlue;border-style:None;width:100%;" /></td>
    ======================================
    </tr><tr class="tablebody2" onclick="javascript:return select(this,'1','WDZL');" ondblclick="__doPostBack('GridWDZL:_ctl4','Edit')" style="height:22px;">
    <td>2</td><td>c768a32f544444f894d7ca4c8bedab31</td><td>25023C58BCA04DC9AA2D8B06AB59D165</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>
    </tr><tr align="Center" valign="Middle" style="font-size:9pt;height:22px;">
    <td colspan="7" style="height:23px;"><a id="GridWDZL__ctl6_lbFirst" disabled="disabled">首页</a>&nbsp;&nbsp;<a id="GridWDZL__ctl6_lbPrve" disabled="disabled">上一页</a>&nbsp;&nbsp;<a id="GridWDZL__ctl6_lbNext" disabled="disabled">下一页</a>&nbsp;&nbsp;<a id="GridWDZL__ctl6_lbLast" disabled="disabled">末页</a>&nbsp;&nbsp;<span id="GridWDZL__ctl6_lblCurPage">【第1页</span><span id="GridWDZL__ctl6_lblPageCount">/共1页】</span>&nbsp;<span id="GridWDZL__ctl6_lblRowCount">【共2条】</span>&nbsp;&nbsp;<input name="GridWDZL:_ctl6:tbGoPage" type="text" id="GridWDZL__ctl6_tbGoPage" disabled="disabled" style="font-family:宋体;font-size:9pt;height:20px;width:40px;" />&nbsp;&nbsp;<input type="submit" name="GridWDZL:_ctl6:btnGo" value="转到" id="GridWDZL__ctl6_btnGo" disabled="disabled" style="font-family:宋体;font-size:9pt;height:22px;width:40px;" />&nbsp;&nbsp;</td>
    </tr>
    <tr style='height:auto;'><td colspan=7 style='BORDER-BOTTOM: thin solid'></td></tr></tbody><tfoot></tfoot></table><script language=javascript>function DG_moveOnTH(td)
    {
    if(event.offsetX > td.offsetWidth - 6 || event.offsetX < 6)
    td.style.cursor = 'w-resize';
    else
    td.style.cursor = 'default';

    if(td.mouseDown==true)
    {
    if (event.offsetX < 6)
    {
    td2 = td.previousSibling;
    offset = event.x - td2.oldX;
    td2.width = td2.oldWidth + offset;
    td2.style.width = td2.width;         
    table=td;
    while(table.tagName != 'TABLE') {table = table.parentElement;}
    table.width = td2.tableWidth+offset;
    table.style.width = table.width;
    }
    else
    {
    offset = event.x - td.oldX;
    td.width = td.oldWidth + offset;
    td.style.width = td.width;
    td.style.cursor = 'w-resize';
    table=td;
    while(table.tagName != 'TABLE') table = table.parentElement;
    table.width = td.tableWidth+offset;
    table.style.width = table.width;
    }
    }
    }
    function DG_downOnTH(td)
    {
    if(event.offsetX > td.offsetWidth - 6)
    {
    td.mouseDown = true;
    td.oldX = event.x;
    td.oldWidth = td.offsetWidth;
    table = td;
    while(table.tagName != 'TABLE') table = table.parentElement;
    td.tableWidth = table.offsetWidth;
    }
    else if(event.offsetX < 6)
    {
    td2 = td.previousSibling;
    td.mouseDown = true;
    td2.oldX = event.x;
    td2.oldWidth = td2.offsetWidth;
    table = td2;
    while(table.tagName != 'TABLE') table = table.parentElement;
    td2.tableWidth = table.offsetWidth;
    }
    else
    td.mouseDown = false;
    }</script></TD>
      

  4.   

    下面的代码测试可以的:<style>
    input{t:expression(this.ondblclick=function(){get()})}
    </style>
    <table><tr>
    <TD id="TDGridWDZL" valign="top" width="100%" colspan="8" height="100%"><table cellspacing="0" rules="all" border="1" id="GridWDZL" style="height:200px;width:100%;border-collapse:collapse;position:none;WORD-BREAK:break-all;WORD-WRAP:break-word;TABLE-LAYOUT:fixed;"><thead>
    <tr class="tablehead" style="height:22px;">
    <td onmousemove="DG_moveOnTH(this)" onmousedown="DG_downOnTH(this)" onmouseup="this.mouseDown=false" onmouseout="this.mouseDown=false" style="width:10%;">序号</td><td onmousemove="DG_moveOnTH(this)" onmousedown="DG_downOnTH(this)" onmouseup="this.mouseDown=false" onmouseout="this.mouseDown=false" style="width:0px;">BZGXWDID</td><td onmousemove="DG_moveOnTH(this)" onmousedown="DG_downOnTH(this)" onmouseup="this.mouseDown=false" onmouseout="this.mouseDown=false" style="width:0px;">BZJXGXID</td><td onmousemove="DG_moveOnTH(this)" onmousedown="DG_downOnTH(this)" onmouseup="this.mouseDown=false" onmouseout="this.mouseDown=false" style="width:40%;">文档名称</td><td onmousemove="DG_moveOnTH(this)" onmousedown="DG_downOnTH(this)" onmouseup="this.mouseDown=false" onmouseout="this.mouseDown=false" style="width:20%;">文档类型</td><td onmousemove="DG_moveOnTH(this)" onmousedown="DG_downOnTH(this)" onmouseup="this.mouseDown=false" onmouseout="this.mouseDown=false" style="width:10%;">编写人</td><td onmousemove="DG_moveOnTH(this)" onmousedown="DG_downOnTH(this)" onmouseup="this.mouseDown=false" onmouseout="this.mouseDown=false" style="width:20%;">提交时间</td>
    </tr></thead><tbody><tr class="tablebody" onclick="javascript:return select(this,'0','WDZL');" ondblclick="__doPostBack('GridWDZL:_ctl3','Edit')" style="height:22px;">
    <td>1</td><td>cbcdd896fc854c2494110c1814aced2b</td><td>25023C58BCA04DC9AA2D8B06AB59D165</td><td><input name="GridWDZL:_ctl3:_ctl0" type="text" style="background-color:PowderBlue;border-style:None;width:100%;" /></td><td>image/pjpeg</td><td><input name="GridWDZL:_ctl3:_ctl1" type="text" style="background-color:PowderBlue;border-style:None;width:100%;" /></td><td><input name="GridWDZL:_ctl3:_ctl2" type="text" value="2005-2-14 0:00:00" onclick="setday(this,this,'yyyy-mm-dd')" style="background-color:PowderBlue;border-style:None;width:100%;" /></td>
    ======================================
    </tr><tr class="tablebody2" onclick="javascript:return select(this,'1','WDZL');" ondblclick="__doPostBack('GridWDZL:_ctl4','Edit')" style="height:22px;">
    <td>2</td><td>c768a32f544444f894d7ca4c8bedab31</td><td>25023C58BCA04DC9AA2D8B06AB59D165</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>
    </tr><tr align="Center" valign="Middle" style="font-size:9pt;height:22px;">
    <td colspan="7" style="height:23px;"><a id="GridWDZL__ctl6_lbFirst" disabled="disabled">首页</a>&nbsp;&nbsp;<a id="GridWDZL__ctl6_lbPrve" disabled="disabled">上一页</a>&nbsp;&nbsp;<a id="GridWDZL__ctl6_lbNext" disabled="disabled">下一页</a>&nbsp;&nbsp;<a id="GridWDZL__ctl6_lbLast" disabled="disabled">末页</a>&nbsp;&nbsp;<span id="GridWDZL__ctl6_lblCurPage">【第1页</span><span id="GridWDZL__ctl6_lblPageCount">/共1页】</span>&nbsp;<span id="GridWDZL__ctl6_lblRowCount">【共2条】</span>&nbsp;&nbsp;<input name="GridWDZL:_ctl6:tbGoPage" type="text" id="GridWDZL__ctl6_tbGoPage" disabled="disabled" style="font-family:宋体;font-size:9pt;height:20px;width:40px;" />&nbsp;&nbsp;<input type="submit" name="GridWDZL:_ctl6:btnGo" value="转到" id="GridWDZL__ctl6_btnGo" disabled="disabled" style="font-family:宋体;font-size:9pt;height:22px;width:40px;" />&nbsp;&nbsp;</td>
    </tr>
    <tr style='height:auto;'><td colspan=7 style='BORDER-BOTTOM: thin solid'></td></tr></tbody><tfoot></tfoot></table><script language=javascript>function DG_moveOnTH(td)
    {
    if(event.offsetX > td.offsetWidth - 6 || event.offsetX < 6)
    td.style.cursor = 'w-resize';
    else
    td.style.cursor = 'default';

    if(td.mouseDown==true)
    {
    if (event.offsetX < 6)
    {
    td2 = td.previousSibling;
    offset = event.x - td2.oldX;
    td2.width = td2.oldWidth + offset;
    td2.style.width = td2.width;         
    table=td;
    while(table.tagName != 'TABLE') {table = table.parentElement;}
    table.width = td2.tableWidth+offset;
    table.style.width = table.width;
    }
    else
    {
    offset = event.x - td.oldX;
    td.width = td.oldWidth + offset;
    td.style.width = td.width;
    td.style.cursor = 'w-resize';
    table=td;
    while(table.tagName != 'TABLE') table = table.parentElement;
    table.width = td.tableWidth+offset;
    table.style.width = table.width;
    }
    }
    }
    function DG_downOnTH(td)
    {
    if(event.offsetX > td.offsetWidth - 6)
    {
    td.mouseDown = true;
    td.oldX = event.x;
    td.oldWidth = td.offsetWidth;
    table = td;
    while(table.tagName != 'TABLE') table = table.parentElement;
    td.tableWidth = table.offsetWidth;
    }
    else if(event.offsetX < 6)
    {
    td2 = td.previousSibling;
    td.mouseDown = true;
    td2.oldX = event.x;
    td2.oldWidth = td2.offsetWidth;
    table = td2;
    while(table.tagName != 'TABLE') table = table.parentElement;
    td2.tableWidth = table.offsetWidth;
    }
    else
    td.mouseDown = false;
    }</script></TD></tr></table>
    <script>
    function get()
    {
    var s=document.getElementsByName ('GridWDZL:_ctl3:_ctl0')[0];
    if(s==null||typeof(s)=='undefined')
    {
      alert('找不到元素');
    }
    else
    {
      alert(s.value)
    }
    }</script>