Solved

checkbox

Posted on 2004-04-19
5
200 Views
Last Modified: 2013-12-16
Hi,
  If I have say 1000 checkbox and all have the same name, but different value. How do I know which is being checked? If you want to know I am coding my application in coldfusion.

Nick
0
Comment
Question by:SolverSurfer
5 Comments
 
LVL 12

Expert Comment

by:venkateshwarr
ID: 10864384
No you cannot differentiate unless you have different(unique) values for each checkbox.
All the name value pairs are sent to the page(action) seperated by commas.
0
 

Author Comment

by:SolverSurfer
ID: 10864422
I am viewing a page that was developed in ASP and all the checkbox name are all the same, but the value are different.
Upon selecting a list of checkbox and click on the display record buttong, it wouldn't then display the record that I have selected using the checkbox.

How would you construct an array of checkbox in CF?
0
 
LVL 12

Accepted Solution

by:
venkateshwarr earned 125 total points
ID: 10865127
First of all,
you need not create a page with same variable name. you can always create a page with different variable names.

for example, if you are looping you can include the iterator value with a string to make it a different variable,
s1,s2,s3,s4,s5...

I am not much of coldfusion programmer, but I assume it is just like any other server side scripting language...
0
 
LVL 2

Expert Comment

by:Vaishali_chaudhry
ID: 10866188
hi,
first of all why do u need to give same name to all checkboxex, usually this kind of a scenario is used with radio buttons where we give same names to all checkboxes which then show as radio buttons and the one selected will be returned,i agree with venkateshwarr .
0
 

Expert Comment

by:vstrugaru
ID: 10901555
Hello SolverSurfer,

My comment is extracted as a short explanation from different web sites with questions about working with checkboxex under CF.

If you have multiple checkboxes with the same name, whe you send the form you get the values separated by comma of the selected checkboxes.

1000 checkboxes with 1000 values - if you check 500 of them, you get a string of 500 values separated by comma.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question