cakephp2系でformを作成しています。
formヘルパーを使ってinput部分を動的に生成しているのですが、
動的に生成した部分のpost値が取得できません。なぜなのでしょうか?
controllerで$this->log($this->request->data)で確認してみると、
[Model] => Array ( [0] => Array ( [field] => test ) )
と一つ目しか取得できてないない状況です。
lang
1<?php echo $this->Form->create('Model', [ 'type' => 'post','action' => 'add']); ?> 2<?php echo $this->Form->input('model.0.field', ['type' => 'text' ]); 3上記の部分を 4<?php echo $this->Form->input('model.1.field', ['type' => 'text' ]); ?> 5<?php echo $this->Form->input('model.2.field', ['type' => 'text' ]); ?> 6とJSで動的に生成しております。
こちら(jquery)を利用し実際は、
lang
1<?php echo $this->Form->input('Model.0.field', ['type' => 'text','name_format' => 'data[Model][%d][field]']); ?> 2とviewに記載しております。
ご協力お願いいたします。
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。