Re: quickform help with hiding and showing a select menu based on another select's value

From: Date: Tue, 02 Aug 2005 15:15:29 +0000
Subject: Re: quickform help with hiding and showing a select menu based on another select's value
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-20233@lists.php.net to get a copy of this message
> On 8/2/05, Luke Barker <lukebarker@gmail.com> wrote: > hi, > > I posted a question last week about hiding and showing a select menu based > on another select's value in QuickForm. > > I thought I would write again as no one had replied and I had not got much > further with it on my own. In case it wasn't clear what I am trying to do > here is a page where they ahve the same functionality: > > > http://www.flexibletrips.com/live/jsp/booking/home/packages/defaultHome.jsp > > If you select Number of children as 1 - a extra select appears using > javascript, and then another if you select 2 children and so on. So i'm just > after a pointer on how to set up the eleemnts. I can write javascript a > little I just didn't want to code lots of custom stuff if quickforms > handlers can help. > HTML_QF really has no easy way to deal with this kind of thing, seeing as there are multiple optional elements depending on the selection. I would suggest some simple JS. You could quite easily create a QF element called "childAges[]" and use the output of toHtml() in your JS for creating the selects. > thanks for any help in advance > > Luke > > Date: Wed, 27 Jul 2005 > Subject: quickform help - extra select appear upon another select menu > values > Hi, > > In Quickform, I have a dropdown select, number_of_kids, and I want it to > reveal another dropdown, so the user can input age_in_years for each child. > Eg, if they select 2 from number_of_kids, then 2 new selects would appear, > kid1_age_in_years and kid2_age_in_years, so that the user can input a value > for those children. > > I would like to do this in accessible way as well - can anyone suggest a > method that fulfils this requirement? Thank you in advance for any help. > Luke > > -- > > ~L~ > > lukebarker@gmail.com > > -- Justin Patrin

« previous php.pear.general (#20233) next »