实例说明:
<!DOCTYPE html> <html> <% dim cars cars=Request.Form("cars") %> <body> <form action="demo_radiob.asp method="post"> <p>Please select your favorite car:</p> <input type="radio" name="cars" <%if cars="Volvo" then Response.Write("checked")%> value="Volvo">Volvo</input> <br> <input type="radio" name="cars" <%if cars="Saab" then Response.Write("checked")%> value="Saab">Saab</input> <br> <input type="radio" name="cars" <%if cars="BMW" then Response.Write("checked")%> value="BMW">BMW</input> <br><br> <input type="submit" value="Submit" /> </form> <% if cars<>"" then Response.Write("<p>Your favorite car is: " & cars & "</p>") end if %> </body> </html>
标签含义:
使用单选按钮的表单,本例演示如何使用 Request.Form 命令通过单选按钮与用户进行交互。
源代码运行结果如下:
相关文章
标签:asp