Connecting Tech Pros Worldwide Help | Site Map

[PEAR:QuickForm] Dynamically change a dropdown menu according to another menu?

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 12:53 PM
Jean-Fran?ois Lacrampe
Guest
 
Posts: n/a
Default [PEAR:QuickForm] Dynamically change a dropdown menu according to another menu?

Hello,

I've been using QuickForm for a few months now and I am now given a
new challenge:

I've got a search form with a dozen of dropdown menus, the first
dropdown menu being "Brand". If you select either Brand A, B, C, D...
Z, the second dropdown menu "Model" must be dynamically changed to
model AA, AB, AC, AD..., according to the models manufactured by the
brand selected in the first box.

I've seen that done on quite a few sites, but never found if QuickForm
had a quick & clean way of doing that.

Any idea?

Thanks,
JFLac

  #2  
Old July 17th, 2005, 12:53 PM
micha
Guest
 
Posts: n/a
Default Re: Dynamically change a dropdown menu according to another menu?

i suppose "dynamically change" means on the spot...

using php - not possible, because to change the page you have to make a
trip to the server and back, i.e. reload the page.

if you dont't mind the trip to the server, it's easy. just have php
print the selects according to the submitted values.

using javscript - possible, but maybe not good

1. many people have turned off javascript. they will never be able to
use your search, unless you build in a fallback.

2. you'll have to include every possible choice for the selects in the
code from the very start (because there is no trip back to the server),
which is likely to make huge files - not good

3. if you want to use javascript anyway: have a look at DOM, especially
appending, removing and altering children (because every option of a
select is a child to that select)

micha

  #3  
Old July 17th, 2005, 12:53 PM
Good Man
Guest
 
Posts: n/a
Default Re: Dynamically change a dropdown menu according to another menu?

"micha" <chotiwallah@web.de> wrote in news:1114687283.519957.306190
@f14g2000cwb.googlegroups.com:

[color=blue]
> 1. many people have turned off javascript. they will never be able to
> use your search, unless you build in a fallback.[/color]

really? "many people"?

anyone that disables javascript is probably used to many websites not
working properly, and have probably switched it on by now.

I just can't see anyone going into browser settings and shutting off
javascript in 2005...
  #4  
Old July 17th, 2005, 12:53 PM
R. Rajesh Jeba Anbiah
Guest
 
Posts: n/a
Default Re: Dynamically change a dropdown menu according to another menu?

micha wrote:
<snip>[color=blue]
> 1. many people have turned off javascript. they will never be able to
> use your search, unless you build in a fallback.[/color]

That's why the PHP version has to be first done and the JavaScript
"speeding up processes" have to be lately--by hooking the forms and
elements (using external js file) and act accordingly than by mixing
JavaScript with HTML.
[color=blue]
> 2. you'll have to include every possible choice for the selects in[/color]
the[color=blue]
> code from the very start (because there is no trip back to the[/color]
server),[color=blue]
> which is likely to make huge files - not good[/color]

Yes, buffering in JS isn't a better solution. But, AJAX technique
might be used to avoid memory issues.

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

  #5  
Old July 17th, 2005, 12:54 PM
micha
Guest
 
Posts: n/a
Default Re: Dynamically change a dropdown menu according to another menu?


Good Man wrote:[color=blue]
> "micha" <chotiwallah@web.de> wrote in news:1114687283.519957.306190
> @f14g2000cwb.googlegroups.com:
>
>[color=green]
> > 1. many people have turned off javascript. they will never be able[/color][/color]
to[color=blue][color=green]
> > use your search, unless you build in a fallback.[/color]
>
> really? "many people"?
>[/color]

well, "many" is just a phrase i use in these cases. it's probably not
that many in numbers, but consider for instance people accessing the
net with other hard-/software than screen/browser, like blind people
using braille readers.
i do web developement for the public sector in germany. we must (by
law) design apps accessible to everyone, which forbids to code any
crucial functionality in js.
[color=blue]
> anyone that disables javascript is probably used to many websites not[/color]
[color=blue]
> working properly, and have probably switched it on by now.
>
> I just can't see anyone going into browser settings and shutting off
> javascript in 2005...[/color]

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.