JeroenDortmans
Technical User
I want to make a form with 2 radio buttons and 1 submit button. When the user clicks the submit button a cookie must be written. The contents of this cookie differs corresponding the selected radio button. After that the page must redirect corresponding the selected radio button. When no radio button is selected, a message must be written. Here my code:
<%
dim PC_or_CAD
PC_or_CAD=Request.Form("PC_or_CAD"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
%>
<form action="Write_cookie.asp" method="post">
<p><font color="#FF0000"><b>Select one of these options. After that click on
"Submit information". This will store the information so you won't be
bothered with this question again.<br>
</b></font><input type="radio" name="Radio_button"
<%if PC_or_CAD = "PC" then Response.Write("checked"
%>
value="PC"> You use a PC<br>
<input type="radio" name="Radio_button"
<%if PC_or_CAD = "CAD" then Response.Write("checked"
%>
value="CAD"> You use a CAD system
<br>
<input type="submit" value="Submit information">
</form>
<%
if PC_or_CAD="PC" then
Response.Cookies("PC_or_CAD"
="You use a PC."
Response.Cookies("PC_or_CAD"
.Expires = Date() + 365
Response.Redirect "COCO_PC.asp"
Else
Response.Cookies("PC_or_CAD"
="You use a CAD system."
Response.Cookies("PC_or_CAD"
.Expires = Date() + 365
Response.Redirect "COCO_CAD.asp"
end if
%>
I hope some one can help me with this!
<%
dim PC_or_CAD
PC_or_CAD=Request.Form("PC_or_CAD"
%>
<form action="Write_cookie.asp" method="post">
<p><font color="#FF0000"><b>Select one of these options. After that click on
"Submit information". This will store the information so you won't be
bothered with this question again.<br>
</b></font><input type="radio" name="Radio_button"
<%if PC_or_CAD = "PC" then Response.Write("checked"
value="PC"> You use a PC<br>
<input type="radio" name="Radio_button"
<%if PC_or_CAD = "CAD" then Response.Write("checked"
value="CAD"> You use a CAD system
<br>
<input type="submit" value="Submit information">
</form>
<%
if PC_or_CAD="PC" then
Response.Cookies("PC_or_CAD"
Response.Cookies("PC_or_CAD"
Response.Redirect "COCO_PC.asp"
Else
Response.Cookies("PC_or_CAD"
Response.Cookies("PC_or_CAD"
Response.Redirect "COCO_CAD.asp"
end if
%>
I hope some one can help me with this!