Monday, March 22, 2010

A form with radio buttons using asp

How to interact with the user, through radio buttons, with the Request.Form command.

<% 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
%>