为什么不能直接通过document.getElementById("<%= txtCard.ClientID %>")
来源:互联网 发布:中国企业海外并购数据 编辑:程序博客网 时间:2024/04/28 02:30
function prjClrInfo(ipt){ var prjclr = document.getElementById("<%= txtClr.ClientID %>"); prjclr.value = ipt.GetTextByName("clr")+" "+ipt.GetTextByName("flwsht"); var card=document.getElementById("txtCard_text"); var prj=document.all("txtPrj_text").value; card.sqlFilter="and prj='"+prj+"'"; prjclr.readOnly = "readonly"; }
<td style="width:10%">生产单:</td><td style="width:23%"> <KYWEBCTL:EPDblTextBox ID="txtPrj" runat="server" DelwithFunction="prjClrInfo" DataType="ColPrjMessRight" Required="true"></KYWEBCTL:EPDblTextBox></td><td style="width:10%">颜色/花型:</td><td style="width:23%"> <KYWEBCTL:EPTextBox ID="txtClr" runat="server" DataType="EP_TXT"></KYWEBCTL:EPTextBox></td><td style="width:10%">卡号:</td><td style="width:23%"> <KYWEBCTL:EPDblTextBox ID="txtCard" runat="server" DataType="CardMess" Required="false"/></td>
用生产单过滤卡号的时候,不能直接通过document.getElementById("<%= txtCard.ClientID %>")获取该卡号控件的ID,后面用浏览器调试的时候,发现在浏览器将该控件
<KYWEBCTL:EPDblTextBox ID="txtCard" ……
解析为
<span><input name="txtCard$text" type="text" id="txtCard_text" title="您可以输入部分字符,以便打开选择对话框!Input Some Character Open Dialog Box!" isAutoBack="False" isEdit="False" delwithFunction="" mouseOpen="" onblur="javascript:;if(this.isChanged){resetDBTextBox(this);OpenModalDialog(this,"/jetpoint");this.isChanged = false;};" onchange="javascript:this.isChanged = true;" isChanged="false" dataType="CardMess" isMultiSelect="False" IsPartSearch="False" textField="" sqlFilter="" xml="" style="border-color:DodgerBlue;" /><input name="txtCard$id" type="text" value="-1" readonly="readonly" id="txtCard_id" onchange="javascript:;" style="display:none;" /><input name="txtCard$xml" type="text" readonly="readonly" id="txtCard_xml" style="width:40px;display:none;" /><img id="txtCard_image" title="您可以鼠标单击打开选择对话框!Click Mouse Left key Open Dialog Box!" onclick="resetDBTextBox(this.parentNode.childNodes[0]);OpenModalDialog(this.parentNode.childNodes[0],"/jetpoint")" src="/jetpoint/Resource/picture/button/Editable.gif" style="border-width:0px;vertical-align:text-bottom;cursor:hand;height:20px;width:21px;" /><input type="hidden" name="txtCard$searchValue" id="txtCard_searchValue" /></span>
无奈只能直接这样使用txtCard_text作为ID了。
----------------------------------
问题已解决,该控件是他们自定义的控件,重写之后就不能这样取ID了。
0 0
- 为什么不能直接通过document.getElementById("<%= txtCard.ClientID %>")
- var fGrid = document.getElementById("<%=gvReturnSgd.ClientID %>") 的理解
- 为什么不能直接通过IP访问网站
- 为什么不能直接通过IP访问网站
- 为什么不能直接通过IP访问网站
- 为什么不能直接通过IP访问网站
- document.getElementById 不能获取值的问题
- js通过document.getElementById获取不到对象
- $get() == document.getElementById()
- label的Visible="False"时用alert(document.getElementById("aa").innerText);会报错,为什么呢?
- document.getElementById()
- document.getElementById()
- document.getElementById()
- document.getElementById
- document.getElementById()
- 直接使用Id和使用document.getElementById()的比较
- document.getElementById("divv").style.display = 'none';
- document.getElementById("id").onclick=tt
- 在开发板上挂载/卸载SD卡
- 我常常浏览的博客和网站
- android监听器(Listener)的使用
- Oracle EBS Form CUSTOM.PLL详解
- VC++ 使用导入位图创建工具栏
- 为什么不能直接通过document.getElementById("<%= txtCard.ClientID %>")
- Block存储域
- asp.net mvc3网站部署在IIS6的方法
- 住在我隔壁储藏室的大学刚毕业的小夫妻[转载]
- Objective c 自动释放池
- java集合框架中HashMap源码(基于JDK1.6)
- jQuery高亮当前选中菜单
- Android proguard 详解
- java运行字符串中的算式