Re: Re: [PEPr] Comment on HTML::HTML_QuickForm_advmultiselect

From: Date: Mon, 13 Jun 2005 17:05:14 +0000
Subject: Re: Re: [PEPr] Comment on HTML::HTML_QuickForm_advmultiselect
References: 1 2 3 4  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-38092@lists.php.net to get a copy of this message
On 6/13/05, Laurent Laville <pear@laurent-laville.org> wrote: > I don't think follows very well your mind way. What you expected to have : > > 1. an alternate way for browser that have js disabled ? > 2. another way to manage both lists ? > you wrote : " ... Client-side JS switch visibility for the select > elements. ..." > > Please explains me , i've some doubt ! This is actually a pretty good solution. In the PHP you should set the "hidden" element as visible and the two new elements as hidden. Then after they're output just put in some quick script to make them visible. i.e. hidden ones should have style="visibility: hidden; display: none;". <script language="javascript"> document.getElementById("hiddenSelect").style.visibility = "hidden"; document.getElementById("hiddenSelect").style.display = "none"; document.getElementById("firstSelect").style.visibility = "visible"; document.getElementById("firstSelect").style.display = ""; document.getElementById("secondSelect").style.visibility = "visible"; document.getElementById("secondSelect").style.display = ""; </script> > > Laurent > > > Philippe Jausions wrote: > > > Laurent Laville wrote: > > > >> Laurent Laville (http://pear.php.net/user/farell) has commented on > >> the proposal for HTML::HTML_QuickForm_advmultiselect. > >> > >> Comment: > >> > >> Philippe, > >> > >> I think that non-js browsers (or js disabled) is a problem for all web > >> application. Even if it's a huge limitation, i can understand that some > >> people are anxious (security reasons perharps) to let js active. > >> > >> This QuickForm element has a *ugly* solution to solve the js disabled. I > >> 'll let you introduce it. It's requires more programmation than just > >> the > >> default behaviour. > >> > >> If end-user keep its selection active without validate (click on) > >> "add" or > >> "remove" buttons: > >> > >> * on left select box, then the element prefixed by two "_" will be > >> transmit when the form will be submit. > >> > >> * on right select box, then the element prefixed by one "_" will be > >> transmit when the form will be submit. > >> > >> Try with any of live demos, and you'll understand what i means. > > > > > > I agree that voluntarly turning off JavaScript is a bit extreme, and > > by the same token we can't support antic web browsers, such as Mosaic > > for those who remember ;-) > > > > But since you're using JS and CSS styles, why not doing something like > > this (from your 1st example) > > > > 1. cars[] select element is visible, > > 2. _cars[] and __cars[] are invisible, > > 3. Client-side JS switch visibility for the select elements. > > > > I haven't look deeply into your code, but do you think that could work? > > > > -Philippe > > > > > > > > > > -- > PEAR Development Mailing List (http://pear.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Justin Patrin

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