• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 227
  • Last Modified:

checkbox

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
SolverSurfer
Asked:
SolverSurfer
1 Solution
 
venkateshwarrCommented:
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
 
SolverSurferAuthor Commented:
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
 
venkateshwarrCommented:
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
 
Vaishali_chaudhryCommented:
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
 
vstrugaruCommented:
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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now