I’ve created buttons that have been edited with css to look like hyperlinks so I can use form post instead of using querystring. I’ve made it so that when a button is clicked it creates a checkbox for each user. I want it so that when i change the state of the checkbox I want it to save as I’m going through different letters. I believe the problem I am having is because the “hyperlinks” are really buttons and changing the checked state of a checkbox is creating problems. I would prefer not to use JavaScript but if its the only way for me to get the results that I want then I would use java-script. Code provided below –
<form action="Table.asp" method="post" name="form2">
<input type="submit" name="Button" value="#" style="background:transparent;border:0;display:inline;color:#00F;text-decoration:underline;padding:0px;cursor:pointer">
<% for i = 97 to 122 %>
<input type="submit" name="Button" value="<%=CHR(i) %>" style="background:transparent;border:0;display:inline;color:#00F;text-decoration:underline;padding:0px;cursor:pointer;">
<% next %>
</br></br></br>
<%
alphaB = request.form("Button")
if alphaB <>"" then
%>
<input type="checkbox" name="checkBox" value="<%=alphaB %>" <%=session("checkBox") %>>
<%
response.write alphaB
end if
alphaCheck = request.form("checkBox")
if alphaCheck <>"" then
session("checkBox") = "checked"
else
session("checkBox") = ""
end if
all you got wrong is the place where you set your session …
move
before the checkbox creation
what happen is that on the first time your session is not initialized once you hit the page