asp中实现最简单的下拉菜单,
<tr><tdnowrap="nowrap"style="width:164px"width="30"><fontface="宋体">职位名称:</font></td><...
<tr>
<td nowrap="nowrap" style="width: 164px" width="30">
<font face="宋体">职位名称:</font>
</td>
<td width="79%">
<asp:TextBox ID="gn" runat="server" Width="139px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="gn"
ErrorMessage="请输入职位名称"></asp:RequiredFieldValidator></td>
</tr>
这是我写的textbox,加个下拉菜单,选项是销售和行政。 展开
<td nowrap="nowrap" style="width: 164px" width="30">
<font face="宋体">职位名称:</font>
</td>
<td width="79%">
<asp:TextBox ID="gn" runat="server" Width="139px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="gn"
ErrorMessage="请输入职位名称"></asp:RequiredFieldValidator></td>
</tr>
这是我写的textbox,加个下拉菜单,选项是销售和行政。 展开
1个回答
展开全部
<td width=118 align=right>婚姻状况:</td>
<td width=382>
<select name=marrage>
<option value=0 selected>未婚</option>
<option value=1 <% if marrage="1" then response.write "selected"%>>已婚</option></select>
</select>
这是最简单的
复杂一点的有
<td width=118 align=right>月收入:</td>
<td width=382>
<select name="earning">
<%
sql=" SELECT * FROM t_earning"
rs.open sql,conn,3,1
for i=1 to rs.recordcount
response.write "<option value="&rs("c_earning_id")
if rs("c_earning_id")=cint(earning) then response.write " selected "
response.write ">"&trim(rs("c_earning_txt"))&"</option>" & vbCrLf
rs.movenext
next
rs.close
%>
</select>
<td width=382>
<select name=marrage>
<option value=0 selected>未婚</option>
<option value=1 <% if marrage="1" then response.write "selected"%>>已婚</option></select>
</select>
这是最简单的
复杂一点的有
<td width=118 align=right>月收入:</td>
<td width=382>
<select name="earning">
<%
sql=" SELECT * FROM t_earning"
rs.open sql,conn,3,1
for i=1 to rs.recordcount
response.write "<option value="&rs("c_earning_id")
if rs("c_earning_id")=cint(earning) then response.write " selected "
response.write ">"&trim(rs("c_earning_txt"))&"</option>" & vbCrLf
rs.movenext
next
rs.close
%>
</select>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询