如何设置style将TextBox和DropDownList重合在一起

taylermail 2013-05-27 09:07:48
我想做一个DropDownList下拉带可录入,如何设置style将TextBox和DropDownList重合在一起
<asp:TableRow Height="40" >
<asp:TableCell ID="TableCell11" cssClass="tb_edit_label">施工单位:</asp:TableCell>
<asp:TableCell ID="k6" style="position:absolute;width: 191px"><asp:TextBox runat="server" ID="construct_units" Columns="40" /></asp:TableCell>

<asp:TableCell ID="TableCell12" cssClass="tb_edit_text">
<asp:DropDownList ID="c_cpu" AutoPostBack="false" runat="server" DataSourceID="SqlDataSource1" DataTextField="dw" DataValueField="dw" style="position:absolute; width: 191px; clip: rect(0 191 30 175);background-color:#ffffff;" onChange='document.all.construct_units.value=this.options[this.selectedIndex].value'></asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:waternewsConnectionString %>" SelectCommand="select mingcheng dw from 表a"></asp:SqlDataSource>
</asp:DropDownList>
</asp:TableCell>
</asp:TableRow>
...全文
127 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
md5e 2013-05-27
  • 打赏
  • 举报
回复
你也可以直接使用控件 FineUI里面有下拉控件,自动补全控件
md5e 2013-05-27
  • 打赏
  • 举报
回复
<div style="position:relative"> <input type="text" style="position:absolute;top:0;left:0"/> <select style="position:absolute;top:0;left:0"> </select> </div>
Scorip 2013-05-27
  • 打赏
  • 举报
回复

<select style="width:90px;" onchange="setResult(this)">
<option>123</option>
<option>123</option>
<option>123</option>
</select><input id="txtResult" type="text" style="width:70px;border-right:none;position: relative;
  left: -90px;" />
<script>
      function setResult(o)
      {
          $("#txtResult").val($(o).val());
      }
</script>
就这样手写的。。应该有错的地方。。。不过意思能明白吧?position: relative; 表示相对定位

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧