Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Asp Dynamic Checkbox In A Table
kvarnerexpress
post Jan 9 2006, 08:46 PM
Post #1


Super Member
*********

Group: Members
Posts: 407
Joined: 13-December 04
Member No.: 2,696



I'd like to add a checkbox for each row so that the user can move to process the checked items to the next page.
I want the checkbox to take the value of the primary key from the database
so assuming that
blabla=rs.fields("code") where the code is the primary key
how can I add a dynamic checkbox to this table for each row


CODE
<table border="1" align="center">
<tr>
<% for each field in rs.fields %>
<td><center> <% response.write("" & field.name & "") %> </center>
</td> <%next %></tr>
<%do until rs.eof
for each field in rs.fields%>
<td><center> <% response.write( "" & field.value & "") %> &nbsp

</center></td>
<%next%> </tr>
<%rs.movenext
loop%>
</table>
<%rs.close
conn.close
set rs=nothing %>
</table>
Go to the top of the page
 
+Quote Post
Tyssen
post Jan 9 2006, 10:17 PM
Post #2



***********

Group: Members
Posts: 1,161
Joined: 9-May 05
From: Brisbane, QLD
Member No.: 6,818



CODE
<td><input type="checkbox" name="?" value="<% =(rs.fields("primaryKey")) %>"></td>

If you want the checkbox to be selected based on a certain parameter, it'd be:

CODE
<td><input type="checkbox" name="?" value="<% =(rs.fields("primaryKey")) %>" <% if (rs.fields("primaryKey") = something then response.write "checked" end if %>></td>
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Java Script Drop Down Menu With Css(2)
  2. Changing A Dynamic Ip(18)
  3. Table/cell Link?(10)
  4. Table Duplication(5)
  5. Css And Javascript Combined For Dynamic Layout(9)
  6. Max Table Width(13)
  7. Dynamic Image / Signature Generator(12)
  8. Adding Rows & Columns In Html Table Using Javascript(1)
  9. Dynamic Php Pages(5)
  10. Can I Make Dynamic Menu In Php(7)
  11. Dynamic Forms Help - How Do I Create These?(8)
  12. Discussion On Dynamic Programming(3)
  13. Trap17 Board Status Dynamic Image(13)
  14. Using Multiple Selection Array In Table To Order Data(1)
  15. Dynamic Signature - Yet Another Way To Do It(0)
  1. Getting An Array Value Of A Dynamic Variable(9)
  2. Ratchet And Clank Future(1)
  3. Which Data Type To Use In Mysql Table(4)
  4. Another Question On Mysql Table Data Type(1)
  5. Table Relationship Problem(2)
  6. Xml For Dynamic Website Content(3)
  7. How To Convert Static Ip To Dynamic Ip`?(9)
  8. Css Table Layouts(8)
  9. Css Table Scaling(5)
  10. Mouse Input In C Programs(5)
  11. Man Arrested For Having Intercourse With A Table?(21)
  12. Trap17 Dynamic Recent Post/topic Image(17)
  13. Create Table - Mysql Code - Help(1)


 



- Lo-Fi Version Time is now: 26th July 2008 - 01:52 PM