Re: Dynamic refresh dropdown list
| From: | Daniel Brown | Date: | Tue, 17 Jul 2007 12:24:56 +0000 |
| Subject: | Re: Dynamic refresh dropdown list | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-258996@lists.php.net to get a copy of this message | ||
On 7/17/07, Sichta, Daniel <Daniel.Sichta@siemens.com> wrote:
Look for AJAX !!!!!
DS
-----Original Message-----
From: C.R.Vegelin [mailto:cr.vegelin@hetnet.nl]
Sent: Tuesday, July 17, 2007 12:57 PM
To: php-general@lists.php.nt
Subject: [PHP] Dynamic refresh dropdown list
I have a selection form with multiple dropdown lists, let's say A, B and
C.
If the dropdown list B is changed, then dropdown list C should be
updated.
To get this done, I use a small javascript
function reload(form)
{ var val=form.B.options[form.B.options.selectedIndex].value;
self.location='myForm.php?B=' + val ;
}
called by
<select id="B" name="B" onChange="reload(this.form);">
This works fine, BUT all other dropdown lists are also reset.
So if I select another A, then another B, then also A is reset to its
prior value.
Any idea how I can refresh a specific dropdown,
without affecting all the other dropdowns ?
TIA, Cor
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Cor,
That's a JavaScript issue, not a PHP issue, so it should really go
to the proper list. However, at first glance, I'd say that you should
call your specific element because, as you have it right now, you're
resetting the whole form, which is causing all fields within said form
to be reset in tandem.
--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107