Solved

checkbox

Posted on 2004-04-19
5
216 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A short article about problems I had with the new location API and permissions in Marshmallow
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
Simple Linear Regression

696 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