CakePHP2.xからCakePHP3.xにバージョンアップしていますが、フォームヘルパーで出力されるidが指定しているにも関わらず違うものが設定されています。指定したidを設定する方法はありますか?
JavaScriptを使用していろいろと操作をしているので大変困っています。
【cakePHP3のフォームヘルパーで設定したコード】
CakePHP
1<?php echo $this->Form->input('rdoZaishokuKbn1', ['type' => 'radio', 'id' => 'rdoZaishokuKbn11', 'name' => 'rdoZaishokuKbn1', 'options' => array('1' => ''), 'onclick' => 'shokumuKikanListCtl(1);', 'label' => false, 'templates' => ['inputContainer' => '{{content}}', 'inputContainerError' => '{{content}{error}}'], 'hiddenField' => false]); ?>在職中 2<?php echo $this->Form->input('rdoZaishokuKbn1', ['type' => 'radio', 'id' => 'rdoZaishokuKbn01', 'name' => 'rdoZaishokuKbn1', 'options' => array('2' => ''), 'onclick' => 'shokumuKikanListCtl(1);', 'label' => false, 'templates' => ['inputContainer' => '{{content}}', 'inputContainerError' => '{{content}{error}}'], 'hiddenField' => false]); ?>離職中
出力されたコード(CakePHP3.x)
HTML
1<label for="rdozaishokukbn1-1"> 2 <input name="rdoZaishokuKbn1" disabled="" id="rdozaishokukbn1-1" onclick="shokumuKikanListCtl(1);" type="radio" value="1"> 3</label> 4在職中 5<label for="rdozaishokukbn1-2"> 6 <input name="rdoZaishokuKbn1" disabled="" id="rdozaishokukbn1-2" onclick="shokumuKikanListCtl(1);" type="radio" value="2"> 7</label> 8離職中
ちなみなに、バージョンアップ前の出力されたコード(CakePHP2.x)は
HTML
1<input name="rdoZaishokuKbn1" disabled="" id="rdoZaishokuKbn11" onclick="shokumuKikanListCtl(1);" type="radio" value="1"> 2在職中 3<input name="rdoZaishokuKbn1" disabled="" id="rdoZaishokuKbn01" onclick="shokumuKikanListCtl(1);" type="radio" value="2"> 4離職中

回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2018/10/12 03:53
2018/10/12 03:55 編集
2018/10/13 02:26