Ricky11
asked on
Frontpage radiobutton onclick page reloads then radio button is not selected anymore
This is my form.. I use radio buttons to select a certian size, it works well. but when the page reloads the radio button which is selected is not selected, i.e. none of the radio buttons are selected anymoren, i want the selected radio button to still be selected when the page reloads..
>>> following code by arroentz
Yes, you would use a form (called form1), and instead of links you would use Radio Buttons or a dropdown:
<input type=radio name=size onclick="window.form1.subm
<input type=radio name=size onclick="window.form1.subm
<input type=radio name=size onclick="window.form1.subm
That will submit the form to itself when the size is selected. Then to access the info:
if request("size") <> "" then
arr = split(request("size"), "|") 'split on PIPE symbol added above
productid = arr(0)
size = arr(1)
response.write "Product: " & productid & "<br>"
response.write "Size: " & size & "<br>"
end if
to see a similar working model
go to www.homenlinens.com click on one of the linen pictures and then select one of the sizes from the radio button, you will see the page reloading but the selcted size is not selected anymore...
ASKER
I have changed the code as follows so it is more easier, but i have added your code but it still does not allow the radio button to be marked.
here is my website www.homenlinens.com click on one of the two linens and then it will take you to table.asp where it should show the availavble sizes and some radio buttons click on the radio buttons and see that it does not highlight.
Code as follows :
<form name="form1" method="post">
<% c=1
DO while (FP_FieldURL(fp_rs,"Size" & c)) <> ""
%>
<input type=radio name=size onclick="PostPage('<%=FP_F ieldURL(fp _rs,"Size" & c)%>','<%=FP_FieldURL(fp_r s,"Product ID")%>');r eturn false;"><%if CStr(FP_FieldURL(fp_rs,"Si ze" & c)) = CStr(size) then response.write " CHECKED" end if%>
<%=unescape(FP_FieldURL(fp _rs,"Size" & c))%><br>
<%
c=c+1
LOOP
%>
</form>
here is my website www.homenlinens.com click on one of the two linens and then it will take you to table.asp where it should show the availavble sizes and some radio buttons click on the radio buttons and see that it does not highlight.
Code as follows :
<form name="form1" method="post">
<% c=1
DO while (FP_FieldURL(fp_rs,"Size" & c)) <> ""
%>
<input type=radio name=size onclick="PostPage('<%=FP_F
<%=unescape(FP_FieldURL(fp
<%
c=c+1
LOOP
%>
</form>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry I tried that,.,
I think the only difference was
Response.Write "size=" & CStr(size) & "<BR>"
but even after adding that line the effect is teh same, i.e. the radio button still does not remain active when it is selected.
any other ideas.
thanks.
I think the only difference was
Response.Write "size=" & CStr(size) & "<BR>"
but even after adding that line the effect is teh same, i.e. the radio button still does not remain active when it is selected.
any other ideas.
thanks.
Could you please post the output when you added the 2 Response.Writes ?
ASKER
Sorry for the long delay
Even after adding the second response.write the output is very messy. it still does not make the radio button stick.
I am going back to the original code, and then I will repost this questions again.
Thanks.
Even after adding the second response.write the output is very messy. it still does not make the radio button stick.
I am going back to the original code, and then I will repost this questions again.
Thanks.
<%if CStr(FP_FieldURL(fp_rs,"Si
like so:
<input type=radio name=size onclick="window.form1.subm
<input type=radio name=size onclick="window.form1.subm
<input type=radio name=size onclick="window.form1.subm