Re: Populating fields dynamically
| From: | josemaria | Date: | Fri, 11 Apr 2003 11:55:46 +0000 |
| Subject: | Re: Populating fields dynamically | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-27017@lists.php.net to get a copy of this message | ||
Hi shaun,
you can do it in tthis way:
after populating the select, you should include inside the select tag an
OnChange clause:
<select OnChange='some action here...'>
, this way when a user is selected, you detect it. then, you can submit your
form with the value, the action will be the same page, and include a
if ($your_employee_submitted_id) {
...
// make a select in your DB with a 'WHERE id = '$your_employee_submitted_id'
// and include here a javascript function like:
}
document.your_form.your_field.value = '<?php echo
$field_value_taken_from_previous_query?>';
{
...
}
"Shaun" <shaun@mania.plus.com> escribió en el mensaje
news:20030410113614.53081.qmail@pb1.pair.com...
> Hi,
>
> I have a table called offices in my database. Each office has an ID. Is it
> possible to have a drop down menu on a page so that when an office id is
> selected from it, the other text fields on the are populated i.e. office
> name, office address, office telephone number?
>
> Thanks for your help
>
>