Re: [fw-general] How to add select=selected in Zend_Form_Element_Multiselect
2008/8/26 vladimirn [EMAIL PROTECTED]: Huh, i think you dont understand me :)) I dont know how to put onClick event in select tag :) I know how to make this without zend form, but cant figure it out how to put onClick in $listOptions array:) I will use CAPS just to point on some lines :) sorry about that :) This array build my select tag if i understud well: $listOptions = array( 'first'='first choice', 'second' ='second choice', 'third' = 'third choice' ) and then i am building multiselect as: $lists = new Zend_Form_SubForm(); $lists-addElements(array( new Zend_Form_Element_Multiselect('nameOfMultiselect',array( 'label' = 'Select all you can apply', 'required' =true, 'filters' =array('StringTrim'), 'multiOptions' = $listOptions, 'value' = array('second'), // this one sometimes works and sometimes not, i cant figure it out why 'onClick' ='some javascrpt code here',// THIS IS APPLIED ON SELECT TAG INSTEAD ON OPTION TAG :)) 'validators'= array( array('InArray', false, array(array_keys($listOptions))) ) )), And later this will be displayed as bellow select name=lists[nameOfMultiselect][] id=lists-nameOfMultiselect multiple=multiple onClick=some javascript code here// there is unwanted onClick event lol, i want this onClick inside of option tag option value=first label=first choicefirst choice/option option value=second label=second choicesecond choice/option//THIS ONE SHOULD BE SELECTED, RIGHT? But somehow it is not :) Well, sometimes it is selected, but not this time :) option value=third label=third choicethird choice/option// here i need onClick event :) Matthew Weier O'Phinney-3 wrote: -- vladimirn [EMAIL PROTECTED] wrote (on Tuesday, 26 August 2008, 12:23 PM -0700): Thanks for the link and for guide lines. I thought that something like that should be solution, but i need to rephrase my question- how to add on click in my array? is there somethin like: new Zend_Form_Element_Multiselect('nameOfMultiselect',array( 'label' = 'Select all you can apply', 'required' =true, 'filters'=array('StringTrim'), 'multiOptions' = $listOptions, 'value' = array('eml'), 'onClick' = 'DoSomething'// --- Yep -- any configuration key that does not correspond to an accessor is then set as an object property, and passed as an attribute to the view helper. and more, how to add this on specific array key/value which i am building in $listOptions = array( 'first'='first choice', 'second' ='second choice', 'third' = 'third choice', 'clickOne' = 'I want this one to opena hidden text area :)' ); Again, go to your favorite JS toolkit mailing list or IRC channel. :) Matthew Weier O'Phinney-3 wrote: -- vladimirn [EMAIL PROTECTED] wrote (on Tuesday, 26 August 2008, 11:15 AM -0700): Well, is there a room to ask another question? or should i open a new topic? I need to add hidden text area bellow multiselect, and if you select third choice, this hidden box should appear visible. How to set up something like this? Use javascript to do this. When the page renders, do two things: * hide the element (set the visibility attribute to 'collapse') * connect an event handler to the multiselect option that looks for the number of selected options and re-displays the hidden element. For techniques on this, visit your favorite JS toolkit mailing list or IRC channel. p.s. [off topic] about zend dojo webinar- can u post a link to my mail or here pls? Sure: http://www.zend.com/en/company/news/event/webinar-zend-framework-and-dojo-integration -- Matthew Weier O'Phinney Software Architect | [EMAIL PROTECTED] Zend Framework | http://framework.zend.com/ -- View this message in context: http://www.nabble.com/How-to-add-select%3Dselected-in-Zend_Form_Element_Multiselect-and-one-more-question-%3A%29-tp19166233p19168608.html Sent from the Zend Framework mailing list archive at Nabble.com. -- Matthew Weier O'Phinney Software Architect | [EMAIL PROTECTED] Zend Framework | http://framework.zend.com/ -- View this message in context: http://www.nabble.com/How-to-add-select%3Dselected-in-Zend_Form_Element_Multiselect-and-one-more-question-%3A%29-tp19166233p19169726.html Sent from the Zend Framework mailing list archive at Nabble.com. Again, go to your favorite JS toolkit mailing list or IRC channel. :) Use the onchenge event of your select tag. -- Regards, Martin Martinov http://mmartinov.com/
Re: [fw-general] How to add select=selected in Zend_Form_Element_Multiselect
Martin Martinov-2 wrote: Use the onchenge event of your select tag. -- Regards, Martin Martinov http://mmartinov.com/ Thanks Martin, but if i use onChange event in select tag, this will show hidden text area on any change inside multiselect, right? I need to make text area visible only if user choose third option. -- View this message in context: http://www.nabble.com/How-to-add-select%3Dselected-in-Zend_Form_Element_Multiselect-and-one-more-question-%3A%29-tp19166233p19176062.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] How to add select=selected in Zend_Form_Element_Multiselect
2008/8/27 vladimirn [EMAIL PROTECTED]: Martin Martinov-2 wrote: Use the onchenge event of your select tag. -- Regards, Martin Martinov http://mmartinov.com/ Thanks Martin, but if i use onChange event in select tag, this will show hidden text area on any change inside multiselect, right? I need to make text area visible only if user choose third option. -- View this message in context: http://www.nabble.com/How-to-add-select%3Dselected-in-Zend_Form_Element_Multiselect-and-one-more-question-%3A%29-tp19166233p19176062.html Sent from the Zend Framework mailing list archive at Nabble.com. Well, you'll just have to count how many options are selected in the onchange event handler, and show/hide your textarea as appropriate. This list is really not the place to discuss this thing :-) -- Regards, Martin Martinov http://mmartinov.com/
Re: [fw-general] How to add select=selected in Zend_Form_Element_Multiselect
Well, ok. Thanks for your reply. I still dont understand how to put onClick or some other event inside option tag which is created by Zend_Form_Element_Multiselect. I was not asking how to use js. Martin Martinov-2 wrote: 2008/8/27 vladimirn [EMAIL PROTECTED]: Martin Martinov-2 wrote: Use the onchenge event of your select tag. -- Regards, Martin Martinov http://mmartinov.com/ Thanks Martin, but if i use onChange event in select tag, this will show hidden text area on any change inside multiselect, right? I need to make text area visible only if user choose third option. -- View this message in context: http://www.nabble.com/How-to-add-select%3Dselected-in-Zend_Form_Element_Multiselect-and-one-more-question-%3A%29-tp19166233p19176062.html Sent from the Zend Framework mailing list archive at Nabble.com. Well, you'll just have to count how many options are selected in the onchange event handler, and show/hide your textarea as appropriate. This list is really not the place to discuss this thing :-) -- Regards, Martin Martinov http://mmartinov.com/ -- View this message in context: http://www.nabble.com/How-to-add-select%3Dselected-in-Zend_Form_Element_Multiselect-and-one-more-question-%3A%29-tp19166233p19176713.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] How to add select=selected in Zend_Form_Element_Multiselect
I was searching all over but failed to find a way to add selected=selected into multiselect. My code is like this: [code] $listOptions=(array( 'first'= 'first choice', 'second' = 'second choice', 'third' = 'third choice' ); $lists = new Zend_Form_SubForm(); $lists-addElements(array( new Zend_Form_Element_Multiselect('nameOfMultiselect',array( 'label' = 'Select all you can apply', 'required' =true, 'filters' =array('StringTrim'), 'multiOptions' = $listOptions, 'validators'= array( array('InArray', false, array(array_keys($listOptions))) ) )) )); [/code] I would like to have selected second choice when multiselect display. How this can be done? Thanks, Vladimir -- View this message in context: http://www.nabble.com/How-to-add-select%3Dselected-in-Zend_Form_Element_Multiselect-tp19166233p19166233.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] How to add select=selected in Zend_Form_Element_Multiselect
-- vladimirn [EMAIL PROTECTED] wrote (on Tuesday, 26 August 2008, 10:29 AM -0700): I was searching all over but failed to find a way to add selected=selected into multiselect. My code is like this: [code] $listOptions=(array( 'first'= 'first choice', 'second' = 'second choice', 'third' = 'third choice' ); $lists = new Zend_Form_SubForm(); $lists-addElements(array( new Zend_Form_Element_Multiselect('nameOfMultiselect',array( 'label' = 'Select all you can apply', Add a value. Multiselect expects an array of keys that should be selected: 'value' = array('second'), 'required'=true, 'filters' =array('StringTrim'), 'multiOptions'= $listOptions, 'validators' = array( array('InArray', false, array(array_keys($listOptions))) ) )) )); [/code] I would like to have selected second choice when multiselect display. How this can be done? -- Matthew Weier O'Phinney Software Architect | [EMAIL PROTECTED] Zend Framework | http://framework.zend.com/
Re: [fw-general] How to add select=selected in Zend_Form_Element_Multiselect
Matthew Weier O'Phinney-3 wrote: -- vladimirn [EMAIL PROTECTED] wrote (on Tuesday, 26 August 2008, 10:29 AM -0700): I was searching all over but failed to find a way to add selected=selected into multiselect. My code is like this: [code] $listOptions=(array( 'first'= 'first choice', 'second' = 'second choice', 'third' = 'third choice' ); $lists = new Zend_Form_SubForm(); $lists-addElements(array( new Zend_Form_Element_Multiselect('nameOfMultiselect',array( 'label' = 'Select all you can apply', Add a value. Multiselect expects an array of keys that should be selected: 'value' = array('second'), 'required' =true, 'filters'=array('StringTrim'), 'multiOptions' = $listOptions, 'validators' = array( array('InArray', false, array(array_keys($listOptions))) ) )) )); [/code] I would like to have selected second choice when multiselect display. How this can be done? -- Matthew Weier O'Phinney Software Architect | [EMAIL PROTECTED] Zend Framework | http://framework.zend.com/ Dang! as simply as that :) Thank you Matthew. Well, is there a room to ask another question? or should i open a new topic? I need to add hidden text area bellow multiselect, and if you select third choice, this hidden box should appear visible. How to set up something like this? Thanks a lot, Vladd p.s. [off topic] about zend dojo webinar- can u post a link to my mail or here pls? -- View this message in context: http://www.nabble.com/How-to-add-select%3Dselected-in-Zend_Form_Element_Multiselect-tp19166233p19167409.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] How to add select=selected in Zend_Form_Element_Multiselect
-- vladimirn [EMAIL PROTECTED] wrote (on Tuesday, 26 August 2008, 11:15 AM -0700): Well, is there a room to ask another question? or should i open a new topic? I need to add hidden text area bellow multiselect, and if you select third choice, this hidden box should appear visible. How to set up something like this? Use javascript to do this. When the page renders, do two things: * hide the element (set the visibility attribute to 'collapse') * connect an event handler to the multiselect option that looks for the number of selected options and re-displays the hidden element. For techniques on this, visit your favorite JS toolkit mailing list or IRC channel. p.s. [off topic] about zend dojo webinar- can u post a link to my mail or here pls? Sure: http://www.zend.com/en/company/news/event/webinar-zend-framework-and-dojo-integration -- Matthew Weier O'Phinney Software Architect | [EMAIL PROTECTED] Zend Framework | http://framework.zend.com/
Re: [fw-general] How to add select=selected in Zend_Form_Element_Multiselect
Thanks for the link and for guide lines. I thought that something like that should be solution, but i need to rephrase my question- how to add on click in my array? is there somethin like: new Zend_Form_Element_Multiselect('nameOfMultiselect',array( 'label' = 'Select all you can apply', 'required' =true, 'filters' =array('StringTrim'), 'multiOptions' = $listOptions, 'value' = array('eml'), 'onClick' = 'DoSomething'// --- and more, how to add this on specific array key/value which i am building in $listOptions = array( 'first'='first choice', 'second' ='second choice', 'third' = 'third choice', 'clickOne' = 'I want this one to opena hidden text area :)' ); :)) Matthew Weier O'Phinney-3 wrote: -- vladimirn [EMAIL PROTECTED] wrote (on Tuesday, 26 August 2008, 11:15 AM -0700): Well, is there a room to ask another question? or should i open a new topic? I need to add hidden text area bellow multiselect, and if you select third choice, this hidden box should appear visible. How to set up something like this? Use javascript to do this. When the page renders, do two things: * hide the element (set the visibility attribute to 'collapse') * connect an event handler to the multiselect option that looks for the number of selected options and re-displays the hidden element. For techniques on this, visit your favorite JS toolkit mailing list or IRC channel. p.s. [off topic] about zend dojo webinar- can u post a link to my mail or here pls? Sure: http://www.zend.com/en/company/news/event/webinar-zend-framework-and-dojo-integration -- Matthew Weier O'Phinney Software Architect | [EMAIL PROTECTED] Zend Framework | http://framework.zend.com/ -- View this message in context: http://www.nabble.com/How-to-add-select%3Dselected-in-Zend_Form_Element_Multiselect-and-one-more-question-%3A%29-tp19166233p19168608.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] How to add select=selected in Zend_Form_Element_Multiselect
-- vladimirn [EMAIL PROTECTED] wrote (on Tuesday, 26 August 2008, 12:23 PM -0700): Thanks for the link and for guide lines. I thought that something like that should be solution, but i need to rephrase my question- how to add on click in my array? is there somethin like: new Zend_Form_Element_Multiselect('nameOfMultiselect',array( 'label' = 'Select all you can apply', 'required'=true, 'filters' =array('StringTrim'), 'multiOptions'= $listOptions, 'value' = array('eml'), 'onClick' = 'DoSomething'// --- Yep -- any configuration key that does not correspond to an accessor is then set as an object property, and passed as an attribute to the view helper. and more, how to add this on specific array key/value which i am building in $listOptions = array( 'first'='first choice', 'second' ='second choice', 'third' = 'third choice', 'clickOne' = 'I want this one to opena hidden text area :)' ); Again, go to your favorite JS toolkit mailing list or IRC channel. :) Matthew Weier O'Phinney-3 wrote: -- vladimirn [EMAIL PROTECTED] wrote (on Tuesday, 26 August 2008, 11:15 AM -0700): Well, is there a room to ask another question? or should i open a new topic? I need to add hidden text area bellow multiselect, and if you select third choice, this hidden box should appear visible. How to set up something like this? Use javascript to do this. When the page renders, do two things: * hide the element (set the visibility attribute to 'collapse') * connect an event handler to the multiselect option that looks for the number of selected options and re-displays the hidden element. For techniques on this, visit your favorite JS toolkit mailing list or IRC channel. p.s. [off topic] about zend dojo webinar- can u post a link to my mail or here pls? Sure: http://www.zend.com/en/company/news/event/webinar-zend-framework-and-dojo-integration -- Matthew Weier O'Phinney Software Architect | [EMAIL PROTECTED] Zend Framework | http://framework.zend.com/ -- View this message in context: http://www.nabble.com/How-to-add-select%3Dselected-in-Zend_Form_Element_Multiselect-and-one-more-question-%3A%29-tp19166233p19168608.html Sent from the Zend Framework mailing list archive at Nabble.com. -- Matthew Weier O'Phinney Software Architect | [EMAIL PROTECTED] Zend Framework | http://framework.zend.com/
Re: [fw-general] How to add select=selected in Zend_Form_Element_Multiselect
Huh, i think you dont understand me :)) I dont know how to put onClick event in select tag :) I know how to make this without zend form, but cant figure it out how to put onClick in $listOptions array:) I will use CAPS just to point on some lines :) sorry about that :) This array build my select tag if i understud well: $listOptions = array( 'first'='first choice', 'second' ='second choice', 'third' = 'third choice' ) and then i am building multiselect as: $lists = new Zend_Form_SubForm(); $lists-addElements(array( new Zend_Form_Element_Multiselect('nameOfMultiselect',array( 'label' = 'Select all you can apply', 'required' =true, 'filters' =array('StringTrim'), 'multiOptions' = $listOptions, 'value' = array('second'), // this one sometimes works and sometimes not, i cant figure it out why 'onClick' ='some javascrpt code here',// THIS IS APPLIED ON SELECT TAG INSTEAD ON OPTION TAG :)) 'validators'= array( array('InArray', false, array(array_keys($listOptions))) ) )), And later this will be displayed as bellow select name=lists[nameOfMultiselect][] id=lists-nameOfMultiselect multiple=multiple onClick=some javascript code here// there is unwanted onClick event lol, i want this onClick inside of option tag option value=first label=first choicefirst choice/option option value=second label=second choicesecond choice/option//THIS ONE SHOULD BE SELECTED, RIGHT? But somehow it is not :) Well, sometimes it is selected, but not this time :) option value=third label=third choicethird choice/option// here i need onClick event :) Matthew Weier O'Phinney-3 wrote: -- vladimirn [EMAIL PROTECTED] wrote (on Tuesday, 26 August 2008, 12:23 PM -0700): Thanks for the link and for guide lines. I thought that something like that should be solution, but i need to rephrase my question- how to add on click in my array? is there somethin like: new Zend_Form_Element_Multiselect('nameOfMultiselect',array( 'label' = 'Select all you can apply', 'required' =true, 'filters'=array('StringTrim'), 'multiOptions' = $listOptions, 'value' = array('eml'), 'onClick' = 'DoSomething'// --- Yep -- any configuration key that does not correspond to an accessor is then set as an object property, and passed as an attribute to the view helper. and more, how to add this on specific array key/value which i am building in $listOptions = array( 'first'='first choice', 'second' ='second choice', 'third' = 'third choice', 'clickOne' = 'I want this one to opena hidden text area :)' ); Again, go to your favorite JS toolkit mailing list or IRC channel. :) Matthew Weier O'Phinney-3 wrote: -- vladimirn [EMAIL PROTECTED] wrote (on Tuesday, 26 August 2008, 11:15 AM -0700): Well, is there a room to ask another question? or should i open a new topic? I need to add hidden text area bellow multiselect, and if you select third choice, this hidden box should appear visible. How to set up something like this? Use javascript to do this. When the page renders, do two things: * hide the element (set the visibility attribute to 'collapse') * connect an event handler to the multiselect option that looks for the number of selected options and re-displays the hidden element. For techniques on this, visit your favorite JS toolkit mailing list or IRC channel. p.s. [off topic] about zend dojo webinar- can u post a link to my mail or here pls? Sure: http://www.zend.com/en/company/news/event/webinar-zend-framework-and-dojo-integration -- Matthew Weier O'Phinney Software Architect | [EMAIL PROTECTED] Zend Framework | http://framework.zend.com/ -- View this message in context: http://www.nabble.com/How-to-add-select%3Dselected-in-Zend_Form_Element_Multiselect-and-one-more-question-%3A%29-tp19166233p19168608.html Sent from the Zend Framework mailing list archive at Nabble.com. -- Matthew Weier O'Phinney Software Architect | [EMAIL PROTECTED] Zend Framework | http://framework.zend.com/ -- View this message in context: http://www.nabble.com/How-to-add-select%3Dselected-in-Zend_Form_Element_Multiselect-and-one-more-question-%3A%29-tp19166233p19169726.html Sent from the Zend Framework mailing list archive at Nabble.com.