472,127 Members | 2,101 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,127 software developers and data experts.

checkbox vs text box

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 '06 #1
2 1647
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 '06 #2
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" <sh***@tampabay.rr.comwrote in message
news:es**************@TK2MSFTNGP05.phx.gbl...
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 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by mike | last post: by
2 posts views Thread by bebop | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.