Multiple results with multiple values

Hy guys I am trying to add two check boxes to each form result alright… In total form has 50 results…

How can I get an array with all 3 parameters per each result on form post?

Each result html:

<div style="float: left;margin-right: 10px;">

delete: <input type="checkbox" name="parameter[]" value="delete">

approve: <input type="checkbox" name="parameter[]" value="approve">

<input type="hidden" name="parameter[userid]" value="1">


Sounds like you are asking for some server side code or php function rather than html/css?

If you can clarify the question a little it might help to find the right category for the question as html and css have nothing to do with arrays as such.:slight_smile:

If it was a layout question then fire ahead :slight_smile: ( also don’t forget your associated labels as checkboxes without labels are hard to hit).

1 Like

I have a moderation page that shows 50 results.

Now id like to add to each result two options approve or delete.

Plus hidden value of userId.

On post grab from each result all those 3 options and pass then in array to php for processing.


Me thinks this is a Javascript question.

1 Like

OK folks looks like Im gonna use this

<select name="moderation[first]">
        <option value="delete">delete</option>
        <option value="approve">approve</option>

<select name="moderation[second]">
        <option value="delete">delete</option>
        <option value="approve">approve</option>

Then that would be a PHP question so not sure why you posted in html and CSS :slight_smile:

Do you want me to move this thread to PHP or perhaps JS or are you sorted now?

As PaulOB said, this is more of a PHP question. The form you’ve displayed is only part of the story.

Where is the PHP that your using to post this form to the database? Is it in the head of the file or in a separate file?

Well, not exactly like that, surely? A numeric index would be easier to code.

<select name="moderation[1]">
<select name="moderation[2]">
... and so on

Or use whatever unique index that the 50 options have in the database table, if they’re coming from one.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.