Can anyone help me that as i am new to CakePHP i want to create a an input box of array type.
my code is
<?php echo $this->Form->input('txt', array('type' => 'text','label' => 'Field 1')); ?>
output for this is :
<input type="text" id="AddmoreTxt" multiple="multiple" name="data[Addmore][txt]">
but i want the output like
<input type="text" id="AddmoreTxt" multiple="multiple" name="data[Addmore][txt][]">
Put dot after your fieldName like below mentioned in code. I have checked this code.
CakePHP Code
<?php echo $this->Form->input('txt.', array('type' => 'text','label' => 'Field 1')); ?>
Output
<input type="text" id="AddmoreTxt" multiple="multiple" name="data[Addmore][txt][]">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With