0
를 사용하여 여러 선택 상자를 만들어 :액세스 ZF2 내가 젠드 프레임 워크 (2)를 사용하여 양식 객체에 다중 선택 상자를 생성 한 자바 스크립트
$contacts = new Element\Select('contacts');
$contacts->setLabel('All Contacts')
->setAttribute('name', 'contacts')
->setAttribute('multiple', 'multiple')
->setAttribute('size', 10)
->setOptions(array('options' => $users));
형태의 버튼을 누를 때 약간의 자바 스크립트를 실행하고 싶습니다
:
<select name="contacts[]" multiple="multiple" size="10">
,745 : 페이지가 여러 선택 요소의 이름을 생성 할 때
$moveAllRight = new Element\Button('moveAllRight');
$moveAllRight->setLabel('Move All ->')
->setAttribute('value', 'Move All ->')
->setAttribute('onClick', 'moveAll(this.form.contacts,this.form.newContacts)');
불행히도, []에 추가된다 내가 JS 함수 호출 내에서 이름을 변경 시도
:
->setAttribute('onClick', 'moveAll(this.form.contacts[],this.form.newContacts[])');
하지만 난 여전히 일을 점점 운을 가지고 있지 않다거야. 선택 상자에서 여러 옵션을 제거하면 작동하지만 모든 가능한 경우 여러 선택 상자를 사용하고 싶습니다. 이 작업을 수행 할 수있는 방법이 있습니까?