For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > October 2005 > RE: [PHP-DB] Link Selected









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author RE: [PHP-DB] Link Selected
Nur_Adman@fmi.com

2005-10-17, 3:55 am

Dear All,

I am a new PHP programmer. I need help from all of you.

I want to make Linked ComboBox between 2 or more ComboBoxs (connect to
Database).
For example:
When I clicked the main field, the sub items field will display the data
automatically on other ComboBox.

Are there somebody could help me?

Thank You & Regards,

Anita
Micah Stevens

2005-10-17, 3:55 am


Sounds like more of a Javascript problem than a PHP one. Maybe some Ajax to
get the updates?

On Sunday 16 October 2005 11:46 pm, Nur_Adman@fmi.com wrote:
> Dear All,
>
> I am a new PHP programmer. I need help from all of you.
>
> I want to make Linked ComboBox between 2 or more ComboBoxs (connect to
> Database).
> For example:
> When I clicked the main field, the sub items field will display the data
> automatically on other ComboBox.
>
> Are there somebody could help me?
>
> Thank You & Regards,
>
> Anita

Koen Wagemans

2005-10-17, 7:55 am

There are some possibilities:

1) Define a link to the same page in your first combobox (<option
value"..">..</option> and execute him when he is selected (with
Javascript).
Be sure that you take the value off the selected item to the folowing page.
Your second combi will be reloaded and here you fill the value in the
where clause

2) The divantage off the first solution is that your page is
reloaded, this way you lose the values that are allready fild in. A
way to avoid that is to work with popups.
Work with a link to the popup in the first combo.
Let the query be exetuted in the popup and put the values with
Javascript in the second combo.
(opener.document.form.fourni.options[opener.document.form.fourni.selectedIn=
dex].value)

3) Load all the possibilties in javascript arrays and then point to them


Regards

Koen

On 17/10/05, Micah Stevens <micah@raincross-tech.com> wrote:
>
> Sounds like more of a Javascript problem than a PHP one. Maybe some Ajax =

to
> get the updates?
>
> On Sunday 16 October 2005 11:46 pm, Nur_Adman@fmi.com wrote:
a[color=darkred]
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Bastien Koert

2005-10-17, 6:55 pm

Its really more of a js problem, youonly need PHP to populate the vairous JS
arrays. I use this (http://www.mattkruse.com/javascript/dynamicoptionlist/)
js code to make the population happen and it works well and I found it easy
to integrate...

Bastien


>From: <Nur_Adman@fmi.com>
>To: <php-db@lists.php.net>
>Subject: RE: [PHP-DB] Link Selected
>Date: Mon, 17 Oct 2005 15:46:01 +0900
>
>Dear All,
>
>I am a new PHP programmer. I need help from all of you.
>
>I want to make Linked ComboBox between 2 or more ComboBoxs (connect to
>Database).
>For example:
>When I clicked the main field, the sub items field will display the data
>automatically on other ComboBox.
>
>Are there somebody could help me?
>
>Thank You & Regards,
>
>Anita
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com