请说明选择/选项标签的工作方式 [英] Please explain how select/option tag is working

查看:56
本文介绍了请说明选择/选项标签的工作方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<html>
<body>
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("/db/northwind.mdb"))
set rs=Server.CreateObject("ADODB.recordset")
sql="SELECT DISTINCT Country FROM Customers ORDER BY Country"
rs.Open sql,conn
country=request.form("country")
%>
<form method="post">
Choose Country <select name="country">
<% <big> do until rs.EOF
    response.write("<option")
    if rs.fields("country")=country then
      response.write(" selected")
    end if
    response.write(">")
    response.write(rs.fields("Country"))
    rs.MoveNext</big>
loop
rs.Close
set rs=Nothing %>
</select>
<input type="submit" value="Show customers">
</form>

推荐答案

select标记创建一个下拉列表-请参见 ^ ]

在这种情况下,它使用javascript访问数据库,并从那里检索列表.
The select tag creates a drop down list - see W3Schools, select tag[^]

In this case, it is using javascript to access a database, and retrieve the list from there.


这篇关于请说明选择/选项标签的工作方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆