The current structure of the forms looks like...

<?= $form->create('Schedule'); ?>
<table border="0" class="formTable">

        <tr>
                <td>Rig:</td>
                <td class="element"><?= $form->select('rig_id', $listRigs, 
null, array(),
false); ?></td>
        </tr>
        
        <tr>
                <td>Rider 1 (PM):</td>
                <td class="element"><?= $form->select('rider_1', 
$listEmployees, null,
array('style' => 'width: 250px'), false); ?></td>
        </tr>
        
        <tr>
                <td>Rider 2 (PM/EMT):</td>
                <td class="element"><?= $form->select('rider_2', 
$listEmployees, null,
array('style' => 'width: 250px'), false); ?></td>
        </tr>
        
        <tr>
                <td>Rider 3:</td>
                <td class="element"><?= $form->text('rider_3'); ?></td>
        </tr>
        
        <tr>
                <td>Event:</td>
                <td class="element"><?= $form->text('event'); ?></td>
        </tr>
        
        <tr>
                <td>Event Location:</td>
                <td class="element"><?= $form->text('event_location'); ?></td>
        </tr>

        <tr>
                <td>&nbsp;</td>
                <td class="element alt"><?= $form->submit('Submit'); ?></td>
        </tr>

</table>
<?= $form->end(); ?>

As you can see I have a dropdown for Rig but I would like that to be
replaced bythe system we are currrently talking about. I would like that
form to iterate, minus the submit button over each vehicle and have them
post all at the same time - I was not aware that I could simply add a
numerical index between the model and field name...


thatsgreat2345 wrote:
> 
> 
> If you explain the structure of the forms you need help can be
> provided.
> Such as , multiple models.
> 
> $form->Input('Model.Field');
> $form->Input('AnotherModel.Field');
>  or like
> 
> $form->input('Model.0.field');
> $form->input('Model.0.anotherfield');
> 
> 
> 
> Check out
> http://book.cakephp.org/view/75/Saving-Your-Data
> 
> Which this should show you how to format your arrays , and then you
> can create your forms accordingly so that the proper array format is
> returned.
> 
> On Nov 23, 11:01 am, WildFoxMedia <[EMAIL PROTECTED]> wrote:
>> How so? Assuming I looped through each vehicle like..
>>
>> <? foreach($fleetVehicle as $vehicle) { ?>
>> <?= $form->select('rider_1', $listEmployees); ?>
>> <? } ?>
>>
>> Wouldnt 'rider_1' always be overridden by the last 'rider_1' input on the
>> page?
>>
>> What naming convention could I use to make this work - I would truly
>> appreciate even the smallest snippet.
>>
>> Thanks
>>
>>
>>
>> thatsgreat2345 wrote:
>>
>> > What is wrong with that, right naming conventions on the form inputs
>> > will easily return a properly formatted array to save.
>>
>> > On Nov 22, 12:24 pm, WildFoxMedia <[EMAIL PROTECTED]> wrote:
>> >> I am working on a website for a fleet company. The vehicles will all
>> show
>> >> up
>> >> up a 31 day calendar with there respective personnel and tasks.
>>
>> >> My issue right now is that they would like forms for all of there
>> >> vehicles
>> >> to show up on the form for each day. For instance, every day will have
>> an
>> >> edit page where you will be able to see all of the vehicles, each with
>> >> there
>> >> own respective forms for personnel assigned and tasks.
>>
>> >> What is the best way to go about this as it doesnt seem that I can
>> really
>> >> follow the standard Cake guidelines given that they essentially want
>> to
>> >> mash
>> >> 4-5 seperate forms into one page that will all POST at the same time.
>>
>> >> Thank you
>> >> --
>> >> View this message in
>> >>
>> context:http://www.nabble.com/Create-Update-multiple-records-from-one-form-tp...
>> >> Sent from the CakePHP mailing list archive at Nabble.com.
>>
>> --
>> View this message in
>> context:http://www.nabble.com/Create-Update-multiple-records-from-one-form-tp...
>> Sent from the CakePHP mailing list archive at Nabble.com.
> > 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Create-Update-multiple-records-from-one-form-tp20640161p20650006.html
Sent from the CakePHP mailing list archive at Nabble.com.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to