asp中实现最简单的下拉菜单,

<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,加个下拉菜单,选项是销售和行政。

第1个回答  2013-06-06
<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>

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网