checkbox vs text box

Discussion in 'ASP General' started by shank, Dec 9, 2006.

  1. shank

    shank Guest

    I posted this in an HTML forum, but I think it's going to take some
    scripting to act as I want to act.

    I have a form with multiple records.
    My intention is to have the user click a checkbox for each product he wants.
    Then submit the form placing multiple items in his cart.
    If I use a text box like the following and enter a 1 for each product,
    submit, no problem.
    The user gets the products he wants.
    <input name="qty" type="text" value="0">

    However, if I use the following checkbox code, and assuming the user checks
    4 products half way down the page, he will get the first 4 products in the
    recordset. If he clicks 1 checkbox, he will always get the first product,
    not the product he chose.
    <input name="qty" type="checkbox" value="1">

    What I have found is when I submit the form to a blank test page using
    checkoxes or text boxes, there's a considerable difference. The text boxes
    deliver a comma delimination for each occurance. The checkboxes only offer
    comma delimination for each checkbox that is selected. At this point, I'm
    assuming that's the difference between the two and it cannot be changed
    through HTML.

    How can I make the checkboxes act as text boxes?

    thanks
    shank, Dec 9, 2006
    #1
    1. Advertising

  2. shank

    Guest

    Hi Shank

    Not sure if I am on the right track here, but are you using a different
    name for each of the checkboxes? and how are they generated, from a
    database or hard coded. Can we see the relevant part of your code.

    Cheers

    Tony

    shank wrote:

    > I posted this in an HTML forum, but I think it's going to take some
    > scripting to act as I want to act.
    >
    > I have a form with multiple records.
    > My intention is to have the user click a checkbox for each product he wants.
    > Then submit the form placing multiple items in his cart.
    > If I use a text box like the following and enter a 1 for each product,
    > submit, no problem.
    > The user gets the products he wants.
    > <input name="qty" type="text" value="0">
    >
    > However, if I use the following checkbox code, and assuming the user checks
    > 4 products half way down the page, he will get the first 4 products in the
    > recordset. If he clicks 1 checkbox, he will always get the first product,
    > not the product he chose.
    > <input name="qty" type="checkbox" value="1">
    >
    > What I have found is when I submit the form to a blank test page using
    > checkoxes or text boxes, there's a considerable difference. The text boxes
    > deliver a comma delimination for each occurance. The checkboxes only offer
    > comma delimination for each checkbox that is selected. At this point, I'm
    > assuming that's the difference between the two and it cannot be changed
    > through HTML.
    >
    > How can I make the checkboxes act as text boxes?
    >
    > thanks
    , Dec 9, 2006
    #2
    1. Advertising

  3. shank

    Bob Lehmann Guest

    I'm not sure I follow you, but checkboxes aren't posted unless they're
    checked.

    And you can't change that.

    Bob Lehmann

    "shank" <> wrote in message
    news:...
    > I posted this in an HTML forum, but I think it's going to take some
    > scripting to act as I want to act.
    >
    > I have a form with multiple records.
    > My intention is to have the user click a checkbox for each product he

    wants.
    > Then submit the form placing multiple items in his cart.
    > If I use a text box like the following and enter a 1 for each product,
    > submit, no problem.
    > The user gets the products he wants.
    > <input name="qty" type="text" value="0">
    >
    > However, if I use the following checkbox code, and assuming the user

    checks
    > 4 products half way down the page, he will get the first 4 products in the
    > recordset. If he clicks 1 checkbox, he will always get the first product,
    > not the product he chose.
    > <input name="qty" type="checkbox" value="1">
    >
    > What I have found is when I submit the form to a blank test page using
    > checkoxes or text boxes, there's a considerable difference. The text boxes
    > deliver a comma delimination for each occurance. The checkboxes only offer
    > comma delimination for each checkbox that is selected. At this point, I'm
    > assuming that's the difference between the two and it cannot be changed
    > through HTML.
    >
    > How can I make the checkboxes act as text boxes?
    >
    > thanks
    >
    >
    Bob Lehmann, Dec 9, 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. tshad
    Replies:
    0
    Views:
    480
    tshad
    Apr 15, 2005
  2. Replies:
    1
    Views:
    1,140
    David Wier
    Aug 5, 2005
  3. Neelu
    Replies:
    1
    Views:
    536
    TechBookReport
    Jan 10, 2006
  4. Gnarlodious
    Replies:
    4
    Views:
    17,553
    elizas
    May 5, 2010
  5. Shank

    checkbox vs text box

    Shank, Dec 8, 2006, in forum: HTML
    Replies:
    6
    Views:
    380
    Andy Dingley
    Dec 13, 2006
Loading...

Share This Page