Re: Re: Option Transfer in QF
| From: | Ken Restivo | Date: | Sun, 13 Feb 2005 00:18:24 +0000 |
| Subject: | Re: Re: Option Transfer in QF | ||
| References: | 1 2 3 4 5 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-17511@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Fri, Feb 11, 2005 at 04:30:00PM -0800, Jamie Alessio wrote:
> Justin Patrin wrote:
> >On Fri, 11 Feb 2005 15:35:58 -0800, Ken Restivo <ken@restivo.org> wrote:
> >
> >>On Fri, Feb 11, 2005 at 02:15:51PM -0800, Justin Patrin wrote:
> >>
> >>>On Fri, 11 Feb 2005 13:53:15 -0800, Ken Restivo <ken@restivo.org> wrote:
> >>>
> >>>>Has anyone implemented multiselect option transfer using QF? I'd rather
> >>>>not be blazing new ground on which no human has ever tread.
> >>>>
> >>>>Basically an option-transfer is somewhat similar to a heirselect, and
> >>>>if I had to implement it myself I'd probably start by subclassing or
> >>>>copy-pasting the heirselect code.
> >>>>
> >>>>Here's a non-QF example:
> >>>>http://www.quirksmode.org/js/transfer.html
> >>>>
> >>>
> >>><snip>
> >>>
> >>>Funny you should ask now. There are no currently published
> >>>implementations, but Jamie Alessio is working on one (CCed to this
> >>>message). It may even be done by now. Check the PEAR-Dev list for the
> >>>discussion about it.
> >>>
> >>
> >>Interesting... and pretty slick. Alas, I can't use it. His advmultselect
> >>implementation (with your suggestion of a hidden field) now seems to use
> >>JS exclusively and won't work at all in non-JS browsers.
> >>
> >>But there are some good ideas there and that will help me along, thanks.
> >>
> >
> >
> >Ah...I didn't read your entire post. Well, there's no easy way to make
> >such a thing work without JS. Jamie's version is going to be a normal
> >multiselect when there's no JS support. Making this kind of thing work
> >without JS would put lots of limitations on the script that uses it.
> >It would certainly break QFs in many situations to submit but not
> >process normally.
> >
> >IMHO if someone has turned off JS (or it's not supported) a normal
> >multi-select is fine. JS is pretty ubiquitous now and it's needed for
> >any kind of dynamic processing.
> >
> Ken,
> I must admit that I didn't see your entire original post either. Somehow
> your message never made it over to the gmane.org news server which is
> what I read this list from so I was responding only to what Justin had
> included. I didn't realize you were proposing to move the values back
> and forth with trips to the server and additional PHP+QF processing.
>
> This approach seems do-able and you probably won't even need to make any
> changes to the QF code. Instead, you'll just need your PHP script to
> check which button on the form caused the 'submit' and if it was one of
> the buttons that is for the option transfer just skip past QF's validate
> functions and redraw the form with the data moved between your two
> multi-selects. I'm sure that's a grossly over-simplified version but I'm
> thinking it won't be too tricky to implement (and in my opinion,
> probably way less tricky than accomplishing it with javascript).
>
Alas, I'm on deadline pressure so I'm going to use your code pretty much as-is,
and see how it goes.
At some point I'll try the non-JS version and see how I fare.
BTW, I renamed the moveSelections()'s args to menuUnselected and menuSelected
instead of menuLeft and menuRight, because I need to swap their position on the
screen.
Great code-- so far it works like a champ.
- -ken
- --
- ---------------
The world's most affordable web hosting.
http://www.nearlyfreespeech.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFCDpzQe8HF+6xeOIcRAiLMAJ9ABof53QlzN7zhouydJntA6VhkVACeOBGS
hmirfE/wmYR48r/D9wcupNw=
=V9Ek
-----END PGP SIGNATURE-----