Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2006
    Posts
    2

    Unanswered: need help with asp radio button

    hi.. can anyone help me with the following problem i've encountered..
    i'm doing a update members form.. whereby a member who is log in.. can change his subscription details for a newsletter.. but i hope to show his previous setting.. which is either a YES or a NO.. i cant seem to get it right.. can someone help me with this?

    Code:
    <!-- #INCLUDE FILE="msado15.dll" --> 
    <!-- #INCLUDE FILE="adovbs.inc" -->
    <%
    dim con,rs
    set con=Server.CreateObject("ADODB.Connection")
    set rs=Server.CreateObject("ADODB.Recordset")
    
    con.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../database/Databasezz.mdb") & ";Persist Security Info=False"
    con.open
    minfo=Request.QueryString("Members")
    with rs
    	.ActiveConnection=con
    	.CursorType=adOpenDynamic
    	.lockType=adLockOptimistic
    	.cursorlocation=adUseClient
    	.open "select * FROM MemberInfo where Username='" & minfo & "'"
    end with
    Response.Clear()
    %>
    <form name="form1" method="post" action="UpdateProfile.asp">
        <tr> 
          <td width="238"><b>Nickname</b></td>
          <td width="206"><b><%=rs("Username")%></b>&nbsp;</td>
        </tr>
        <tr>
          <td>
              <% if rs("ReceiveMail")=="Yes"  then  %>
    	     <input type="radio" name="newsletter" value="Yes" checked>Yes
    	     <input type="radio" name="newsletter" value="No">No
              <% else %>
    	     <input type="radio" name="newsletter" value="Yes">Yes
    	     <input type="radio" name="newsletter" value="No" checked>No
              <% end if %>
          </td>
        </tr>
    </table>
    <input type="submit" value="submit">
    </form>
    Last edited by everytime; 07-01-06 at 18:11.

  2. #2
    Join Date
    Jul 2006
    Posts
    2
    Code:
    <%if rs.Fields("ReceiveMail").Value = "Yes" then%>
        <input type="radio" name="Newzletter" value="Yes" echo checked>Yes
        <input type="radio" name="Newzletter" value="No">No
    <%else%>
        <input type="radio" name="Newzletter" value="Yes">Yes
        <input type="radio" name="Newzletter" value="No" echo checked>No
    <%end if%>
    i've retrieved the value out.. but i'm not able to update the new newzletter option into the database.. due to something CheckedChanged event.. how do i go about it? can anyone enlighten me on this? btw.. i'm just using asp, not asp.net..
    Last edited by everytime; 07-01-06 at 18:14.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •