Welcome Guest, Not a member yet? Register   Sign In
Need Assistance with multiple checkbox $_POST issue and submit button.
#3

[eluser]Judgestar[/eluser]
I did create an array for the name and value so the foreach loop made one for each checkbox. I did a var_dump to see what was in the array and this is what is in it:

array(2) { ["name"]=> string(15) "skillrequests[]" ["value"]=> int(851) }
array(2) { ["name"]=> string(15) "skillrequests[]" ["value"]=> int(852) }
array(2) { ["name"]=> string(15) "skillrequests[]" ["value"]=> int(853) }
array(2) { ["name"]=> string(15) "skillrequests[]" ["value"]=> int(886) }
array(2) { ["name"]=> string(15) "skillrequests[]" ["value"]=> int(887) }
array(2) { ["name"]=> string(15) "skillrequests[]" ["value"]=> int(888) }


I tried the code you suggested for the post portion for the submit button but it went nowhere it just went back to the same page and nothing was processed.

here is the code in the view:
Code:
<?php if(!empty($requests)): ?>
    <?php foreach($requests as $r): ?>

     <?php form_open('skills/manage');

      $RequestedID = array(
       'name' => 'skillrequests[]',
       'value' => $r->RequestID
      );
     ?>

     <tr>
      <td class="title-short">?&gt;&lt;?php echo form_checkbox($RequestedID); ?&gt;</td>
      <td class="title-short">&lt;?php echo !empty($r->CreatedDate) ? date('D m-d-y', strtotime($r->CreatedDate)) : 'N/A'; ?&gt;</td>
      <td class="title-short">&lt;?php echo $r->Supervisor; ?&gt;</td>
      <td class="title-short">&lt;?php echo $r->Name; ?&gt;</td>
      <td class="title-short">&lt;?php echo $r->BillingSys; ?&gt;</td>
      <td class="title-short">&lt;?php echo $r->Product; ?&gt;</td>
      <td class="title-short">&lt;?php echo $r->AddRem; ?&gt;</td>
      <td class="title-short">&lt;?php echo $r->RequestDescription; ?&gt;</td>

      &lt;?php echo form_close(); ?&gt;
      &lt;?php echo var_dump($RequestedID); ?&gt;
&lt;?php endforeach; ?&gt;
&lt;?php endif; ?&gt;
    
   </table>

    &lt;?php echo form_open('skills/updateSkill/'.$this->input->post('skillRequests').''); ?&gt;
    &lt;?php echo form_submit('Approve', 'Approve'); ?&gt;
    
    &lt;?php echo form_open('skills/updateSkill/'.$this->input->post('skillRequests').''); ?&gt;
    &lt;?php echo form_submit('Deny', 'Deny'); ?&gt;
    &lt;?php echo form_close(); ?&gt;

What am I doing wrong?


Messages In This Thread
Need Assistance with multiple checkbox $_POST issue and submit button. - by El Forum - 06-06-2012, 07:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB