473,325 Members | 2,342 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

[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
Jul 17 '05 #1
4 4222
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

Jul 17 '05 #2
"micha" <ch*********@web.de> wrote in news:1114687283.519957.306190
@f14g2000cwb.googlegroups.com:

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


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...
Jul 17 '05 #3
micha wrote:
<snip>
1. many people have turned off javascript. they will never be able to
use your search, unless you build in a fallback.
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.
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


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/

Jul 17 '05 #4

Good Man wrote:
"micha" <ch*********@web.de> wrote in news:1114687283.519957.306190
@f14g2000cwb.googlegroups.com:

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


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.
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...


Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: red | last post by:
I have PHP Version 5.0.1 installed on my computer, and according to the pear manual pear is already installed. But how do I tell if it is installed ? for example, how do I get this line, which I...
2
by: william108 | last post by:
I am trying to insert the current date into a database from within an HTML_QuickForm document. Any suggestions on how? Also does anyone know if it is possible to to use regular php type queries...
0
by: stab | last post by:
Hello everybody, I am learning HTML_QuickForm_Controller pear extension. situation: In my project the pages are called by a op get parameter (index.php?op=foobar) and this needs to remain...
0
by: erwinschrijver | last post by:
On a previous installed server my site which uses several PEAR-packages worked fine. Now it's transfered to a new server. (Both servers installed with Windows 2003 / IIS 6, on the previous server...
8
by: lawrence k | last post by:
I wrote a simple CMS for personal use. I'm thinking of using it for other clients now. It's use of the database is slow and inefficient. I'm thinking of switching to the PEAR class listed here: ...
3
by: Yi Chen | last post by:
We have a drop down list on a PHP page, with several product names, and when people click one item, we will refresh the same page with the product name as parameter, and in turn we want to include...
2
by: Paul | last post by:
I am moving an existing app written years ago to a new server. It uses Sigma Template 1.3 and Quickform 1.1.1 and PEAR.php,v 1.1.1.1 2004/02/16 The directory structure is like this: /site...
11
by: cybervigilante | last post by:
I can't seem to change the include path on my local winmachine no matter what I do. It comes up as includ_path .;C:\php5\pear in phpinfo() but there is no such file. I installed the WAMP package...
2
by: Dan | last post by:
Hi all, I'd like to add rules to QuickForm2, however, the version I've downloaded from PEAR seems not to have come with the necessary files. Everywhere I look I see people talking about adding...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.