send value to DB for checkbox that is off


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: send value to DB for checkbox that is off

  1. #1
    Kyle Guest

    send value to DB for checkbox that is off


    This is server side. This is part of a credit application that submits to
    SQL Server. I am trying to display a graphic of a red checkmark on the confirmation
    page where the field is the same as the checkbox checked on the app. I can
    do that easily by setting the value of the checkbox to value="checkmark".
    I then Response.Write that into the <IMG src="./<% bla bla bla %>.gif"> What
    I'm having trouble with is displaying a clear.gif in the fields on the confirmation
    that weren't checked. I need to display something to keep the text from shifting
    around. If the clear.gif is the same size as the checkmark.gif. How can I
    set a value for a checkbox that isn't checked.

    "Colm" <colm_gallagher@hotmail.com> wrote:
    >
    >Kyle,
    >
    >Do you want to do this on the client side - unless you propose submitting
    >the page each time the check is clicked (slow) what you are trying to do
    >is not possible (because it's using server side code).
    >
    >Investige changing images on the client side using javascript by doing a
    >search on www.javascript.com or look through the tips on www.chami.com/tips
    >
    >Unless your question was just quickly typed, it looks like there is a little
    >area of greyness in your "clientside or serverside" thinking. If this is
    >the case, check out this excellent article on msdn:
    >http://support.microsoft.com/support.../Q301/0/97.ASP
    >
    >It's a little bit easy what they do here, but the links at the bottom lead
    >off to a goldmine of ASP resources.
    >
    >--
    >Colm Gallagher
    >www.coralquest.com
    >
    >
    >"Kyle" <rkfinch@generationinformed.com> wrote:
    >>
    >>If Request("Individual") = on Then
    >>checkmark = "checkmark.gif"
    >>Else
    >>checkmark = "nocheckmark.gif"
    >>End If
    >>If Request("Joint") = on Then
    >>checkmark = "checkmark.gif"
    >>Else
    >>checkmark = "nocheckmark.gif"
    >>End If
    >>
    >>I'm trying to display a different graphic for whatever checkbox is checked.
    >>Individual <% Response.Write Request(checkmark) %>
    >>Joint <% Response.Write Request(checkmark) %>



  2. #2
    Russell Jones Guest

    Re: send value to DB for checkbox that is off

    Two ways:

    1. Put an <img> tag containing the transparent gif somewhere on the page.
    Write a client-side page onload script that cycles through the checkboxes
    and either inserts (dynamic) or sets the src property (existing) for the
    <img> tag for that checkbox based on the checked value.

    2. On the server, keep a list of all the checkboxes. When the user submits
    the page, write the img tag for the transparent gif for every checkbox that
    was not sent with the form data (the ones the user didn't check).

    However, it sounds like the easiest method might be to either use absolute
    positioning for the confirmation display, or to put the confirmation display
    text in a table, where you can force the alignment.

    "Kyle" <rkfinch@generationinformed.com> wrote in message
    news:3bb88f50@news.devx.com...
    >
    > This is server side. This is part of a credit application that submits to
    > SQL Server. I am trying to display a graphic of a red checkmark on the

    confirmation
    > page where the field is the same as the checkbox checked on the app. I can
    > do that easily by setting the value of the checkbox to value="checkmark".
    > I then Response.Write that into the <IMG src="./<% bla bla bla %>.gif">

    What
    > I'm having trouble with is displaying a clear.gif in the fields on the

    confirmation
    > that weren't checked. I need to display something to keep the text from

    shifting
    > around. If the clear.gif is the same size as the checkmark.gif. How can I
    > set a value for a checkbox that isn't checked.
    >
    > "Colm" <colm_gallagher@hotmail.com> wrote:
    > >
    > >Kyle,
    > >
    > >Do you want to do this on the client side - unless you propose submitting
    > >the page each time the check is clicked (slow) what you are trying to do
    > >is not possible (because it's using server side code).
    > >
    > >Investige changing images on the client side using javascript by doing a
    > >search on www.javascript.com or look through the tips on

    www.chami.com/tips
    > >
    > >Unless your question was just quickly typed, it looks like there is a

    little
    > >area of greyness in your "clientside or serverside" thinking. If this is
    > >the case, check out this excellent article on msdn:
    > >http://support.microsoft.com/support.../Q301/0/97.ASP
    > >
    > >It's a little bit easy what they do here, but the links at the bottom

    lead
    > >off to a goldmine of ASP resources.
    > >
    > >--
    > >Colm Gallagher
    > >www.coralquest.com
    > >
    > >
    > >"Kyle" <rkfinch@generationinformed.com> wrote:
    > >>
    > >>If Request("Individual") = on Then
    > >>checkmark = "checkmark.gif"
    > >>Else
    > >>checkmark = "nocheckmark.gif"
    > >>End If
    > >>If Request("Joint") = on Then
    > >>checkmark = "checkmark.gif"
    > >>Else
    > >>checkmark = "nocheckmark.gif"
    > >>End If
    > >>
    > >>I'm trying to display a different graphic for whatever checkbox is

    checked.
    > >>Individual <% Response.Write Request(checkmark) %>
    > >>Joint <% Response.Write Request(checkmark) %>

    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center