Alright, so I've got this dynamic form. My problem is.. the name could be anything between "1" to "100000" depending on what the output of a script is and which parts of the output the user chooses to select. What would you do to get all of the values from the form?

Update: Also, assume there could be 1,000 to 2,000 different checkboxes.

Here's what I'm using for my input:

<input type="checkbox" name="<? echo $userRow["id"]; ?>" value="<? echo $userRow["id"]; ?>" />

Bro that is insane..

Name the checkboxes just one name that ends with"[]" like "checkboxes[]"

and then if you want to process it after sending it to a processing page.. it will be sent as an array and you should use:

$value = $_POST['checkboxes'];

foreach ($value as $value2)
{
 echo $value2;
}

by the above code, you will get all the selected values in the checkboxes :P

Sweetness, thank you. Didn't know you could pass an array through a form.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.