Using Ajax to populate a drop-down list
| From: | Don | Date: | Fri, 08 Aug 2008 03:58:56 +0000 |
| Subject: | Using Ajax to populate a drop-down list | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-277867@lists.php.net to get a copy of this message | ||
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?
Thanks,
Don