想做一个弹出窗口,同时带有参数传递。代码如下:
- C# code
<asp:TextBox ID="TextBox1" name="TextBox1" runat="server"></asp:TextBox> <a href="javascript:void(0)" onclick="art.dialog.open('order_search.aspx?tel=document.getElementById("TextBox1").value', { title: '', width: '800', height: 'auto', lock: true })" style="text-decoration: none"> <asp:Label ID="Label4" runat="server" Text="查询订单"></asp:Label> </a>
想在跳转的时候同时把输入的textbox值传到跳转的页面去。但值是空的。该怎么实现,请高手指教。
js很菜的,应该是写错了。
------解决方案--------------------------------------------------------
应该得不到的,应该是页面的周期的问题,JS只认你加载后的控件。
最好是textbox加一个onTextChange事件里处理
------解决方案--------------------------------------------------------
document.getElementById('<%=TextBox1.ClientID %>')
------解决方案--------------------------------------------------------
<a href="javascript:void(0)" > </a>
- JScript code
function GetLogin(ID) { if (ID=0) { var tel= document.getElementById("TextBox1").value; window.showModelessDialog("order_search.aspx?tel=" + tel,"", " width: '800', height: 'auto', lock: true "); }
------解决方案--------------------------------------------------------
------解决方案--------------------------------------------------------
------解决方案--------------------------------------------------------
那你写个方法alert(document.getElementById('<%=TextBox1.ClientID %>').value)测试
结合你的代码,应该这样写:document.getElementById(\"<%=TextBox1.ClientID %>\")