If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > need help with asp radio button

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-01-06, 12:43
everytime everytime is offline
Registered User
 
Join Date: Jul 2006
Posts: 2
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 17:11.
Reply With Quote
  #2 (permalink)  
Old 07-01-06, 17:10
everytime everytime is offline
Registered User
 
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 17:14.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On