Hello again... Sorry, this is like my 5th post in the last 2 days, but thanks for all the help. I have this so far:
Quote:
<%@ Language=VBScript %>
<%
if request.cookies("size")="" then
response.cookies("size")="12px"
response.cookies("size").expires=#December 25,2004#
size="12px"
else
size=request.cookies("size")
end if
%>
<HTML>
<HEAD>
<body>
<%
response.write("Lets see what I can learn using ASP... ")
%>
<p><BR>
<%
response.write("<body bgcolor=yellow>")
%>
<br>
<%
dim yourname
yourname="George Bush"
response.write("<a href='http://www.unco.edu/dss/testlink.asp?name=" & yourname & "'>Did this work?</a>")
response.write(" " & yourname)
%>
<br>
<p>
</script>
</head>
<%
response.write("This is what the cookie is showing for size: " & size)
%>
<body>
<form mehtod="get" action="test.asp">
<select title="Select a Font Size" name="fontsize" id="FontSize" style="width:75px" class="layoutMenu">
<option value="5" <% if request.querystring("fontsize")="5" then response.write("selected") end if %> >5</option>
<option value="11px" <% if request.querystring("fontsize")="11px" then response.write("selected") end if %> >11px</option>
<option value="12px" <% if request.querystring("fontsize")="12px" then response.write("selected") end if %> >12px</option>
<option value="13px" <% if request.querystring("fontsize")="13px" then response.write("selected") end if %> >13px</option>
<option value="14px" <% if request.querystring("fontsize")="14px" then response.write("selected") end if %> >14px</option>
<option value="15px" <% if request.querystring("fontsize")="15px" then response.write("selected") end if %> >15px</option>
<option value="16px" <% if request.querystring("fontsize")="16px" then response.write("selected") end if %> >16px</option>
<option value="17px" <% if request.querystring("fontsize")="17px" then response.write("selected") end if %> >17px</option>
<option value="18px" <% if request.querystring("fontsize")="18px" then response.write("selected") end if %> >18px</option>
<option value="19px" <% if request.querystring("fontsize")="19px" then response.write("selected") end if %> >19px</option>
<option value="xx-large" <% if request.querystring("fontsize")="xx-large" then response.write("selected") end if %> >extra Large</option>-->
</select>
<%
response.cookies("size")= request.querystring("fontsize")
response.cookies("size").expires=#December 12,2004#
%>
<input type="submit" value="GO TO IT!">
</form>
<%
response.write("This is your text: " & request.querystring("fontsize"))
%>
<div id="test">
Here is some text
<br>
<br>
<%
response.write("<center> <font size='" & request.querystring("fontsize") & "'>")
%>
Here is some text
<%
response.write("<center> Your size of text is: " & request.querystring("fontsize") & ". Do you like it?")
%>
<table id="tabletest"><tr><td>did it work on me?</td></tr></table>
Bla Bla
</div>
</BODY>
</HTML>
|
It's a lot closer to what I want it to be but still missing some little things. Right now I'm having a problem with the cookie lagging behind the browser one refresh. For instance, I can chance the font size from 14px to 16px and submit the form. The text size will change on the page, but the cookie value still shows up as 14px after submit until I refresh the page or hit submit again.
Since I'm using the URL value to store the user's text size, this defeats the whole purpose of using cookies in the first place, to store the user's prefrence incase they come back to the page. Is there something I can do to make the cookie remain current right after the first submit?