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

Discussion in 'ASP General' started by Jack, Jan 24, 2006.

  1. Jack

    Jack Guest

    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.
     
    Jack, Jan 24, 2006
    #1
    1. Advertising

  2. <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

    "Jack" <> wrote in message
    news:...
    > Hi,
    > I have a asp page. This page pulls all data from a query. Part of the code
    > is as follows:
    >
    > <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.
     
    Ray Costanzo [MVP], Jan 24, 2006
    #2
    1. Advertising

  3. Jack

    Jack Guest

    Thanks for your help Ray. I appreciate it. Regards.

    "Ray Costanzo [MVP]" wrote:

    > <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
    >
    > "Jack" <> wrote in message
    > news:...
    > > Hi,
    > > I have a asp page. This page pulls all data from a query. Part of the code
    > > is as follows:
    > >
    > > <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.

    >
    >
    >
     
    Jack, Jan 24, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QWJlbCBDaGFu?=
    Replies:
    6
    Views:
    9,523
    Rahul
    May 3, 2006
  2. Replies:
    1
    Views:
    862
  3. Billy
    Replies:
    3
    Views:
    117
    Billy
    Jan 26, 2007
  4. Weston C
    Replies:
    2
    Views:
    196
    Fred Oz
    Sep 15, 2004
  5. Lynn McGuire
    Replies:
    7
    Views:
    184
    Ken Brody
    Nov 18, 2013
Loading...

Share This Page