My problem is a little bit complicate. (I use PHP)
I have two arrays, (simple arrays array[0] = string, array[1] = string…) OK, now I will display the content of two arrays in a webpage. The first array contain names and the second images URL.
Images and names are already displayed (my problem isn’t here).
But now I want to do something else, add a check box near every image, those checkbox r active by default. Ok, now the user can uncheck some inbox;
The final aim, is to get a new array containing only the values of the names and images that had been checked.
I have thought of something simple, crawl the keys (number) of unchecked checkboxes and unset them from my array. But the problem that I didn’t know how to deal with the check boxes
first of all i recomend having just one array:
i think this will make your life much easier. Also in the HTML you could also send the array key
then in your form action you itarate the intial array and remove the unchecked ones.