源代码:
<% dim cars cars=Request.Form("cars") %>
Please select your favorite car:
<%if cars="Volvo" then Response.Write("checked")%> value="Volvo">Volvo
<%if cars="Saab" then Response.Write("checked")%> value="Saab">Saab
<%if cars="BMW" then Response.Write("checked")%> value="BMW">BMW
<% if cars<>"" then Response.Write("
Your favorite car is: " & cars & "
") end if %>
运行结果:
<% dim cars cars=Request.Form("cars") %>
Please select your favorite car:
<%if cars="Volvo" then Response.Write("checked")%> value="Volvo">Volvo
<%if cars="Saab" then Response.Write("checked")%> value="Saab">Saab
<%if cars="BMW" then Response.Write("checked")%> value="BMW">BMW
<% if cars<>"" then Response.Write("
Your favorite car is: " & cars & "
") end if %>