473,834 Members | 1,921 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1731
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******** ******@TK2MSFTN GP05.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3424
by: feanor | last post by:
I need to select children checkboxes when selecting the parent one. This is my function: function SelectChildrens(checkbox_name){ form = document.forms; Sname = checkbox_name.split("-"); for (i=0;i<form.elements.length;i++){ THATname = form.elements.name.split("-"); if (Sname.length==1){ if (THATname==Sname){
0
2408
by: mike | last post by:
Hi there: I've read an excellent "how to"-article by Microsoft (no. 306227) - partly cited cited at the end of this email). I have implemented the code related to the part "How to Add a CheckBox Programmatically" in my code. I have changed it to use a OLDDB.DBReader to populate the datagrid and for the databinding. It works perfectly - also when using the edit-mode in the datagrid.
2
2107
by: bebop | last post by:
I'm using three checkbox web controls in C# .NET and one button, and one labe Is there a way to "group" these individual checkbox web controls If so, do I use a for loop, hashtable, array, etc What I'm looking for is how to determine what checkbox was selected from the three checkbox web controls and have the selected checkbox(es) display in a label
1
4516
by: dx | last post by:
I'm extremely frustrated with ASP.NET...again! To me this should be as simple as setting oCheckBox.Checked = True.. yet for some reason it isn't. I have a user control (ascx) that that has a checkbox and I can't get it to default to checked. I tried radiobuttons and experienced the same result.. can't start them as checked. The really frustrating thing is that I set the attributes of other input controls in the Init() with no problem. ...
0
2815
by: Keith | last post by:
I have a repeater control that contains a HeaderTemplate and an ItemTemplate. Each item contains a checkbox with an ID of chkReconciled, and the header contains a single checkbox with an ID of chkAll. I simply want to have chkAll be checked if every item in the repeater has its checkbox checked. In the code behind page, I can access the checked property of chkReconciled by doing the following: Dim CurrentCheckBox As CheckBox...
0
2290
by: Keith | last post by:
I have a repeater control that contains a HeaderTemplate and an ItemTemplate. Each item contains a checkbox with an ID of chkReconciled, and the header contains a single checkbox with an ID of chkAll. I simply want to have chkAll be checked if every item in the repeater has its checkbox checked. In the code behind page, I can access the checked property of chkReconciled by doing the following: Dim CurrentCheckBox As CheckBox...
10
5225
by: rn5a | last post by:
All the rows in a DataGrid, including the Header, are accompanied with a CheckBox. I want that when the CheckBox in the Header is checked, then all the CheckBoxes should automatically get checked. I set the AutoPostBack property of the CheckBox in the Header to True & am invoking a sub named 'CheckAllRows' on the CheckedChanged event of this CheckBox. The CheckBox in the Header exists within the HeaderTemplate of a TemplateColumn in the...
0
4106
by: cyberdawg999 | last post by:
Greetings all in ASP land I have overcome one obstacle that took me 2 weeks to overcome and I did it!!!!! I am so elated!! thank you to all who invested their time and energy towards helping me with my problems. Now for my new little problem,I had a problem posting the values from checkbox fields to a database and thats the obstacle I overcame. Now the second part is my new problem is that I want that the next time that page loads for...
0
2442
by: dotnetrookie | last post by:
Hi This is my 1st post.I have two checkbox columns in gridview binded through item template. The checkboxes are Category and Subcategory. I have actually removed the duplicate values in the 1st column so that Category is listed only once for the corresponding subcategories. Now I need to make sure that the all the subcategory checkboxes to be checked when the corresponding category checkbox is checked. The issue is that only the first...
0
9799
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10219
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7758
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6954
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5627
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5794
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3978
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3081
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.