Welcome Guest, Not a member yet? Register   Sign In
Processing multiple form posts in one submission.
#3

[eluser]pickupman[/eluser]
You could probably achieve this with one form. You can label your inputs according the section of the form they are in. Also, adding [] to a field name will allow you to post the fields as an array.
Code:
echo '<p>This weeks bookings</p>';
echo form_open('lesson/add');

echo form_label('Paid','paid');
echo from_checkbox('section1_paid[]');

echo form_label('Paid','paid');
echo from_checkbox('section1_paid[]');

echo form_label('Paid','paid');
echo from_checkbox('section1_paid[]');

echo '<p>Next weeks bookings</p>';

echo form_label('Paid','paid');
echo from_checkbox('section2_paid[]');

echo form_label('Paid','paid');
echo from_checkbox('section2_paid[]');


echo form_close();

//Process in controller
$section1_paid = $this->input->post('section1_paid');
$section2_paid = $this->input->post('section2_paid');

foreach($section1_paid as $paid)
{
   //Do something here with values
}
//Rinse and repeat for 2nd section


Messages In This Thread
Processing multiple form posts in one submission. - by El Forum - 05-13-2010, 01:04 PM
Processing multiple form posts in one submission. - by El Forum - 05-13-2010, 01:52 PM
Processing multiple form posts in one submission. - by El Forum - 05-14-2010, 05:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB