Connecting Tech Pros Worldwide Help | Site Map

retrieve record from access into radio button in form (classic asp)

Member
 
Join Date: Jul 2008
Posts: 123
#1: Oct 6 '09
I have Customer table where there is a field called Company Type which store corporate or private. I want to retrieve the value in the table so it is diplayed on classic asp file in radio button. Im using Access.

im trying this in the asp file
Expand|Select|Wrap|Line Numbers
  1. <input type="radio" name="compType" value="<%=rs("compType")%>">Corporate<p>
  2. <input type="radio" name="compType" value="<%=rs("compType")%>">Private
  3.  
is this the correct way?Another is, is it the same for retrieve the value from table field into form list box and how access can retrieve value from the list box and saving it to the database?
jhardman's Avatar
Moderator
 
Join Date: Jan 2007
Location: logan, utah
Posts: 2,690
#2: Oct 7 '09

re: retrieve record from access into radio button in form (classic asp)


Off the top of my head, I believe the code should be:
Expand|Select|Wrap|Line Numbers
  1. <input type="radio" name="compType" value="Corporate"
  2. <%if rs("compType") = "Corporate" then response.write "checked"%> >Corporate</input>
  3. <input type="radio" name="compType" value="Private" 
  4. <%if rs("compType") = "Private" then response.write "checked" %> >Private</input>
  5.  
Jared
Member
 
Join Date: Jul 2008
Posts: 123
#3: Oct 8 '09

re: retrieve record from access into radio button in form (classic asp)


Thank you for this code
Reply