2014-10-21 2 views
0

에 입력 요소를 형성한다. 내가 잘못된 방법으로 그 마지막 문장을 해석추가 인라인 자바 스크립트 내가이 작업을 수행하기 위해 노력하고있어 CakePHP의

* ### Options 
* 
* See each field type method for more information. Any options that are part of 
* $attributes or $options for the different **type** methods can be included in `$options` for input().i 
* Additionally, any unknown keys that are not in the list below, or part of the selected type's options 
* will be treated as a regular html attribute for the generated input. 

암 : FormHelper::input에 대한 문서는 우리에게 알려줍니다? (문제를

echo $this->Form->input("filter.wijk", array(
         'onChange' => 'this.form.submit()', 
         'type' => 'select', 
         'multiple' => true, 
         'options' => $wijkOpties, 
         'label' => false) 
); 

2 유효한 체크 박스 목록의 해결 방법을 수행

1 것은 체크 박스에 포기하고 단순히 일반 선택 목록 요소/상자를 얻을 :

+0

그럼 나는 그것이'' '복수'=> '채널에 만족입니다 생각하지 않습니다 eckbox ',''당신의 코드는 괜찮습니다.리스트가 여러개의 체크 박스리스트로 바뀌면 onChange 역시 복사되지 않습니다! ''multiple '=> true,''를 시도하면 문서에 명시된대로 코드가 올바르게 작동합니다. –

+0

고마워요, 자바 스크립트가 관련해서는 작동하지만, 지금은 더 이상 체크 박스가 아니므로 여기에 체크 박스가 정말로 필요합니다. –

답변

1

당신은 두 가지 옵션이 있습니다)와 같은 :

$i = 0; 
foreach($wijkOpties as $value => $option){ 
    echo $this->Form->input('filter.wijk.' . $i++, array(
           'onChange' => 'this.form.submit()', 
           'label' => $option, 
           'value' => $value, 
           'type' => 'checkbox', 
    )); 
} 

`

관련 문제