Hello,
on 08/08/2008 12:58 AM Don said the following:
Hi,
I have a form with two lists. One is populated with many options while the
second is populated with only a single item. When the first drop-down list
is changed, I call a PHP script sing AJAX to populate the second list. I
also need to perform another task when the second list is changed but it
seems not to work.
I think this is because even though my AJAX script populates the second
drop-down list using pure PHP code, the second drop-down isn't aware of it.
I've tries adding JavaScript code in the AJAX route to add options to the
list but it's not working.
Does anyone have an example of how to do this?
This is being asked overe and over again. No problem.
You may want to try this forms class. It comes with a plug-in that does
exactly that. It can load options in a linked select input depending on
the value of the first input. The options can be loaded statically from
arrays or dynamically from the server using AJAX. There are variants of
the plug-in to load options from many different types of databases.
http://www.phpclasses.org/formsgeneration
Here is a live example:
http://www.meta-language.net/forms-examples.html?example=test_linked_select
Here you can watch a tutorial video about this plug-in:
http://www.phpclasses.org/browse/video/1/package/1/section/plugin-linked-select.html
--
Regards,
Manuel Lemos
Find and post PHP jobs
http://www.phpclasses.org/jobs/
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php