473,769 Members | 5,871 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

checkboxes! URGENT



hi
i need urgent responses..

i have some 15 checkboxex on a form... i want to 1st check the no. of
checkboxes that are checked?? and then loop it that many times adn
insert the quantities the user enters in the text boxes.

do i need to group the checkboxes....h wo can i do that??? how to know
which checkbox is checked because out of the 15 checkbox say 1,5,7, 9th
are checked then i 1st need to get the id from the database adn then
based on htat id retrieved i need to insert values on another table.

pls suggest with a code.

thanks a lot
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 22 '05 #1
5 1809
I'm sorry, everyone is busy dealing with other people's "urgent" demands,
please check back later.

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"VbUser25" <mo************ **@YAHOO.com> wrote in message
news:#6******** ******@TK2MSFTN GP10.phx.gbl...


hi
i need urgent responses..

i have some 15 checkboxex on a form... i want to 1st check the no. of
checkboxes that are checked?? and then loop it that many times adn
insert the quantities the user enters in the text boxes.

do i need to group the checkboxes....h wo can i do that??? how to know
which checkbox is checked because out of the 15 checkbox say 1,5,7, 9th
are checked then i 1st need to get the id from the database adn then
based on htat id retrieved i need to insert values on another table.

pls suggest with a code.

thanks a lot
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 22 '05 #2
On Thu, 06 Jan 2005 00:48:26 -0800, VbUser25
<mo************ **@YAHOO.com> wrote:
i need urgent responses..
Usenet newsgroups aren't the best method for getting responses on your
time table. Most of us read these groups according to *our*
timetable.
i have some 15 checkboxex on a form... i want to 1st check the no. of
checkboxes that are checked?? and then loop it that many times adn
insert the quantities the user enters in the text boxes.

do i need to group the checkboxes....h wo can i do that??? how to know
which checkbox is checked because out of the 15 checkbox say 1,5,7, 9th
are checked then i 1st need to get the id from the database adn then
based on htat id retrieved i need to insert values on another table.
What's wrong with simply implementing a counter for whatever you want
to count?
pls suggest with a code.


Pseudocode:

Counter = 0
If Checkbox1 = Checked Then
Counter = Counter + 1
End If
If Checkbox2 = Checked Then
Counter = Counter + 1
End If
If Checkbox3 = Checked Then
Counter = Counter + 1
End If
Response.Write Counter

You can recode this a dozen different ways in whatever method you
wish, the principal is to increment the counter for each response you
want to count.

Jeff
Jul 22 '05 #3

VbUser25 wrote:
hi
i need urgent responses..

i have some 15 checkboxex on a form... i want to 1st check the no. of
checkboxes that are checked?? and then loop it that many times adn
insert the quantities the user enters in the text boxes.

do i need to group the checkboxes....h wo can i do that??? how to know
which checkbox is checked because out of the 15 checkbox say 1,5,7, 9th are checked then i 1st need to get the id from the database adn then
based on htat id retrieved i need to insert values on another table.


Each checkbox should be named so it's unique, but you know that it's a
checkbox. For example, each name would begin with

checkbox_xxx

Where xxx is the checkbox # in sequential order, a primary key in a
table, etc... something to make it unique

When the form is submitted, do a for...each loop

for each element in request.form
if left(request.fo rm(element),9)= "checkbox_" then
checkboxvalue=r equest.form(ele ment)
checkboxnum=rig ht(element, len(element)-9)

if checkboxvalue=" 1" then
'your code for when the checkbox is checked goes here.
end if
end if
next

Jul 22 '05 #4
"VbUser25" wrote in message news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
:
: hi
: i need urgent responses..

don't we all?

: i have some 15 checkboxex on a form... i want to 1st check the no. of
: checkboxes that are checked?? and then loop it that many times adn
: insert the quantities the user enters in the text boxes.
:
: do i need to group the checkboxes....h wo can i do that??? how to know
: which checkbox is checked because out of the 15 checkbox say 1,5,7, 9th
: are checked then i 1st need to get the id from the database adn then
: based on htat id retrieved i need to insert values on another table.

What you need is a spelling checker and for someone to do your homework.
This is an ASP NG, and you're requiring user intervention. That makes it a
client-side issue. If your form is submitted to the same page or another
then you use request.form to retrieve the values. This requires a
method="post" in your form. If you use method="get" you use
request.queryst ring on the server side.

You haven't stated which language you want to use or if a form is involved
to submit the form so it can be parsed, evaluated and processed. All of
this could be done on the client-side. You state you have check boxes and
suddenly text boxes appear in your message. You're not even sure how to
determine if a checkbox has been checked which means if you need that, you
need help no the client-side. ASP is server-side scripting.

Granted we all make spelling errors but yours are not spelling errors,
they're careless typing errors. If you do not show anymore care to solicit
help by correcting your errors, or at least making an attempt to, why should
we?

: pls suggest with a code.

Show us what you have so far as it will be easier to correct your code than
try to educate you on how it's done. Unless you're willing to pay, you're
going to miss your deadline. If it's homework, we'll help to point you to
the right material so you can educate yourself and get it written. Being
honest will get you more information although we won't do your homework for
you. If your goal is to just have someone do you work for you, then you're
in the wrong place and you've chosen the wrong career.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 22 '05 #5
dp
VbUser25 wrote:
hi
i need urgent responses..

i have some 15 checkboxex on a form... i want to 1st check the no. of
checkboxes that are checked?? and then loop it that many times adn
insert the quantities the user enters in the text boxes.

do i need to group the checkboxes....h wo can i do that??? how to know
which checkbox is checked because out of the 15 checkbox say 1,5,7,
9th are checked then i 1st need to get the id from the database adn
then based on htat id retrieved i need to insert values on another
table.

pls suggest with a code.

thanks a lot
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Use 2's complement/binary type values - e.g.
Assign checkbox 1 a value of 1
Assign checkbox 2 a value of 2
Assign checkbox 3 a value of 4
Assign checkbox 4 a value of 8
Assign checkbox 5 a value of 16
Sum the values so you only have 1 numeric db entry containing the total
value.

Write your self a little subtraction function...

e.g. if check boxes 2 and 4 were checked, the db value would be 10.
10 is not => than 16, so check box 5 is not checked
10 is => than 8 so check box 4 is checked, Subtract 8 from the value (10)
giving a new value of 2
2 is not => than 4, so check box 3 is not checked
2 is => than 2 , so check box 2 is checked, subtract 2 from the value (2)
giving you 0
If value = 0, nothing else is checked.

--
dp
Jul 22 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3965
by: Pete | last post by:
There is a Summary/Example further down... On page one of my site I have a form with some checkboxes and detailed descriptions. When the form is submitted (to page two), the values of the checkboxes are picked up using $_POST and put into session variables. On page two there is another form which is simply a condensed version of the previous one (titles with no descriptions). The checkboxes are named the same on both forms. When...
8
2833
by: DylanM | last post by:
I have some checkboxes that are generated from the results of a database search. At the moment, the checkboxes are part of a table making up a form. Users are going through the form, clicking the boxes and saving to the database at the end with the 'Submit' command button. Is it possible to save the changes as the checkboxes are clicked? I suppose I'd need to write some dynamic ASP event handling at the same time as creating the checkboxes......
8
2842
by: Ralph Freshour | last post by:
I have multiple checkbox's created with an array name because I have many on the same web page - their names are like: frm_chk_delete frm_chk_delete frm_chk_delete frm_chk_delete etc. Here is my code line that creates each checkbox (the php variable get
5
5895
by: @(none) | last post by:
I have a page which is a set of CheckBoxes generated daily and thus the number of Checkboxes changes each day. What I want to do is allow the user to select one or more checkboxes and the push a "Done" button and then have a script which uses a "for" loop to check the status of each box. The code I use for this is Sample checkbox HTML <P STYLE="margin-left: 1.5in"><INPUT TYPE=CHECKBOX NAME="CheckBox0"
6
2847
by: terence.parker | last post by:
I currently have the following JS in my header: function checkall(thestate) { var checkboxes=eval("document.forms.EssayList.file_id") for (i=0;i<checkboxes.length;i++) checkboxes.checked=thestate } This works fine - but the problem is that it doesn't work with my
2
3195
by: john | last post by:
I posted this question to comp.lang.javascript but didn't get a response, so I'll try here. I am using ASP.NET and I have a datagrid. One of the columns in my grid is all checkboxes. When the user clicks on a certain button on the page, which is not in the grid, I want to be able to traverse through all the checkboxes in that column and see how many are checked. This is so that I can give them a confirmation dialog before I do an action...
10
5207
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...
5
11279
by: masterej | last post by:
Developers, Is there any way to disable all checkboxes on a form? I have a form with 160 checkboxes and I want to be able to disable all of them. Is there a way I can do something like this: for (int i = 0; i < 160; i++) { string checkbox = "checkBox" + i.toString(); (Cast)checkbox.enabled = false;
8
6040
by: PeteOlcott | last post by:
http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/grid/tests/test_change_structure.html I would like to completely understand how GUI controls such as this one are constructed. In the ideal case I would like to see all of the source code for a complete working example of a ListBox of CheckBoxes.
7
2293
by: viki1967 | last post by:
I need one function javascript that: 1) when I enter in this htm page I see enabled only checkbox of categories A, M and T; checkboxes of microcategories all disabled; 2-a) If I select the checkbox of macrocategory A, M and T checkboxes all disabled; 2-b) If I select the checkbox of macrocategory M, A and T checkboxes all disabled; 2-c) If I select the checkbox of macrocategory T, A and M checkboxes all disabled; 3) If I select the...
0
9589
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...
1
9994
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9863
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...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7409
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
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3959
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
3562
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
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.