Jump to content
xisto Community
Sign in to follow this  
kvarnerexpress

Asp Dynamic Checkbox In A Table

Recommended Posts

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


<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.eoffor each field in rs.fields%><td><center> <% response.write( "" & field.value & "") %>   </center></td><%next%> </tr><%rs.movenextloop%></table><%rs.closeconn.closeset rs=nothing %></table>

Share this post


Link to post
Share on other sites
<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:

<td><input type="checkbox" name="?" value="<% =(rs.fields("primaryKey")) %>" <% if (rs.fields("primaryKey") = something then response.write "checked" end if %>></td>

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.