This is a forum where members new and old can come to ask questions and get info and opinions. It is not a place to advertise your business or have other forms of advertising, whether it be in your posts or signature.

All links in the forum will not be indexed by Search Engines and any unapproved forms of advertising or spam will be dealt with accordingly, deleted, and that member's account banned.

Forums

Overview » ASP » Session Variables won't hold the information that is passed
Reply

Session Variables won't hold the information that is passed

Michelle Weiler
Member



Since: 04 Oct 2005
Posts: 13
Posted 12 Feb 2010 21:28:54

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>

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>

Seb Adlington
Freaking Member



Since: 09 Aug 2001
Posts: 104
Replied 04 Mar 2010 23:43:00
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

Message
Reply
Follow us on Facebook Follow us on twitter Subscribe to the RSS feed
Activate your free membership today | Login | Currency