Actually, there is a way to do this with PHP.  It may not be the best
method, but it is possible.  You could do it with one single source file,
or multiple.

With a single source file you could do something like this:
The first time through would display the first popup with valid choices. 
Form action would post the results of the popup to the same page.  Now you
have a variable with a value from the first popup.  You can then display
your second popup choices based on the first.  And so on for any remaining
popups.

With multiple source files:
The first page displays the first popup. Form action would post the
results to the next page.  As with the first method, you now have a
variable with a value from the first popup.  Display your second popup
choices based on the first.  And so on...

Pro:  You don't need to learn Javascript.
Con:  The web page is redrawn for each new popup selection - not seamless
like a pure Javascript solution may be.

Using multiple source files may help you keep load time down as well as
make it easier to maintain.  It's a matter of personal choice, I think.

If you don't program Javascript, this is one method you may consider -
though I would encourage anyone writing web pages to learn Javascript. It
can be a real lifesaver!  :-)

With either method (PHP or Javascript), you'll probably want to code in
some way for the user to go back and re-select the first popup, i.e. start
over.

Sorry, I don't have sample code.  I haven't had a need for this type of
popups yet, but I have a project coming up soon that probably will.  If I
get a chance to code up a sample, I'll make it available.

Good luck.

:Mike S.
:Austin TX

On Thu February 5 2004 7:33pm, Micah Stevens wrote:
>
> Javascript is client side programming, PHP is server side and unable to
> control actions and make decisions on what's happening in the browser
> except  in a 'third person' manner.
>
> Simply put, you can't do this with PHP.
>
> On Thu February 5 2004 5:21 pm, alb_shop wrote:
>> Hello all,
>>
>> I've been searching for hours and cannot find the answer or sample in
>> in any forum.
>>
>> What is the best method (any sample or help would be appreciated), to
>> associate popup menus in a form. Choosing the first popup menu (Main
>> categorie) should provide to me the results for the second popup menu
>> (subcategory).
>>
>> Ie : Countries --> states
>>
>> I know that javascript can do this sort of things, but I would like to
>> use only php. Is that possible ?
>>
>> I have two tables in mysql: Countries & states that can be associated
>> by id_country.
>>
>> Thank you


---
Sent: February 6, 2004, 12:09 am

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to