Re: Re: Help with extending HTML_QuickForm_select

From: Date: Mon, 07 Feb 2005 22:18:26 +0000
Subject: Re: Re: Help with extending HTML_QuickForm_select
References: 1 2 3 4  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-36020@lists.php.net to get a copy of this message
On Mon, 2005-02-07 at 22:03, Jamie Alessio wrote: > >>>>You can view an example of how this is currently working at > >>>>http://jalessio.com/pear/advmultselect.php and > >>>>please let me know if you > >>>>have any problems with this in your browser of choice. > >>>> > >>> > >>>I would suggest you instead have another (hidden) box with the > >>>selected values in it *and* selected. Or create a hidden element with > >>>the values for each selected value. This way you don't have to rely on > >>>an onsubmit. > >> > >>The hidden element idea sounds good but how would you make the result look like > >>an array once the form is submitted ? > >> > > > > > > Use another (hidden) multi-select whose name is the actual name of the > > element and select the options in it as they're moved to the > > "selected" box. > > > > So: > > multi-select 1 is the list of unselected options and should > > (techinally) not be submitted > > multi-select 2 holds the currently selected options, but they're not > > "selected" per se as th euse can do what they want. This should also > > (techinally) not be submitted. > > multi-select 3 is hidden and is named after the element (i.e. should > > be submitted). It should hold all of the selected options and the > > options should all be selected. This should be fairly easy to add. > > > I took Justin's idea and updated my code to use a hidden multi-select > that gets updated via javascript on the onClick event of the button that > actually moves the elements on the page for the user. It took me some > time and off-list explanation to figure out that by "hidden > multi-select" Justin meant an actual <select> element that has is hidden > from the user via a "hidden" style attribute and is not a <input > type="hidden"> form element. Once I got that straightened out the rest > made sense and I was able to accomplish the same goal without relying on > the onSubmit form attribute which is a much better solution. > > The updated example is at > http://jalessio.com/pear/advmultselect.php and > the source code is at > http://jalessio.com/pear/advmultselect-src.php if > you want to take a look. Your feedback is welcomed and I'm happy to > clean this up a bit to contribute to the PEAR library if there is interest. Wow, that's nice, I'd like to see this either in QF or as a sub package :-) } else { not } else { try to shorten lines to around 80 chars or so. - Helgi

« previous php.pear.dev (#36020) next »