Forums

ASP

This topic is locked

Session Variables won't hold the information that is passed

Posted 12 Feb 2010 21:28:54
1
has voted
12 Feb 2010 21:28:54 Michelle Weiler posted:
I am setting up a radio button dynamic list and are using session variables so that if they make a selection and the go to the previous page when they come back to the page their selection will still be made.

I set up session variables on a drop down list and it works fine just can't figure out why it won't work on this radio list. Please Help

Here is the code that I set up in Dreamweaver:


<tr>
              <td height="23" colspan="2" valign="bottom" background="/cards/images/topbar2.jpg"><div align="center"><font color="#666666" size="2" face="Arial, Helvetica, sans-serif"><strong>Make 
                a donation to the Association</strong></font></div></td>
            </tr>
            <tr bgcolor="#F2F9FF">
              <td width="89%" valign="middle"><font color="#CC0033" size="2" face="Arial, Helvetica, sans-serif"><strong>
               <!-- <input type=hidden name="OPS" value="X.XX"> -->
                <input <%If (CStr(Session("OPS")) = CStr("25.00")) Then Response.Write("checked=""checked""") : Response.Write("")%> type="radio" name="OPS" value="25.00"  />
                $25.00&nbsp;
                <input <%If (CStr(Session("OPS")) = CStr("50.00")) Then Response.Write("checked=""checked""") : Response.Write("")%> type="radio" name="OPS" value="50.00"/>
                $50.00 &nbsp;&nbsp;
                <input <%If (CStr(Session("OPS")) = CStr("75.00")) Then Response.Write("checked=""checked""") : Response.Write("")%> type="radio" name="OPS" value="75.00"/>
                $75.00</strong></font></td>
            </tr>
            <tr bgcolor="#F2F9FF">
              <td valign="middle"><div align="left"><font color="#CC0033" size="2" face="Arial, Helvetica, sans-serif"><strong>
                <input <%If (CStr(Session("OPS")) = CStr("opsmoney")) Then Response.Write("checked=""checked""") : Response.Write("")%> name="OPS" type=radio value="opsmoney" />
                Other - $
                 <input name="opsmoney" type=text id="opsmoney" size="10" />
                </strong></font><font color="#A61149">
                <br />
<input <%If (CStr(Session("OPS")) = CStr("1")) Then Response.Write("checked=""checked""") : Response.Write("")%> type="radio" name="OPS"  value="1"/>
                </font><span class="style1"><strong>None Selected</strong></span></div></td>
            </tr>

Replies

Replied 04 Mar 2010 23:43:00
04 Mar 2010 23:43:00 Seb Adlington replied:
Hi michelle,

you could try simplifying things a bit

take your lines
<input <%If (CStr(Session("OPS") = CStr("50.00") Then Response.Write("checked=""checked""" : Response.Write(""%> type="radio" name="OPS" value="50.00"/>

and replace with

<input type="radio" name="OPS" value="50.00" <%If (CStr(Session("OPS") = CStr("50.00") Then%>checked="checked"<%END IF%>>

Reply to this topic