How to do use checkbox in a response.write that pulls all data

J

Jack

Hi,
I have a asp page. This page pulls all data from a query. Part of the code
is as follows:
<%
Response.Write "<table border='1' width='80%' height='1' cellspacing='1' >"
Response.Write
"<th>Key</th><th>SubgrantID</th><th>Title</th><th>Unlock</th><th>Unverify"
%>
<%
do until sRS.eof
Key = sRS("SubgrantIntId")
Subgrant = sRS("ComboID")
Title = sRS("Title")
Unlock = sRS("IsChecked")
Unverify = sRS("IsVerified")
%>

<tr>
<td align="center">
<div style="cursor:hand"><p align="left"
OnClick="location.href='mainreportagain1.asp?GrantID=<%Response.Write Key%>'">

<u><font color="#0000FF">
<%Response.Write Key%></font></u></div></td>
<% 'this writes out the key%>
</td>

<td align='center'>
<font color="#000000">
<%Response.Write Subgrant%>

<td align='left'>
<font color="#000000">
<%Response.Write Title%>
</td>
<td align='left'>
<font color="#000000">
<%Response.Write Unlock%>
</td>
<td align='left'>
<font color="#000000">
<%Response.Write Unverify%>
</td>

</tr>

In the above code, in the statements response.write Unlock and
response.write unverify I would like to bring checkboxes. The back end data
for these two fields in the database are actually checkboxes. I would
appreciate any help to handle the situation where the rows should show
checkbox values for the two fields mentioned above. Thanks.
 
R

Ray Costanzo [MVP]

<td align='left'>
<font color="#000000">
<input type="checkbox" id="chkUnlock" name="chkUnlock"
value="<%=Unlock%>">
<label for="chkUnlock"><%=Unlock%></label>
</td>

That would give you a checkbox with a value of your Unlock variable. The
text displayed next to it would also display that value. Instead of using
"Response.Write" I used the shorthand "=".

Ray at work
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top