Reply to Re: dependent select menus

Your name:

Reply:


Posted by Michael on 01/24/07 11:01

<abracad_1999@yahoo.com> schreef in bericht
news:1169596058.014364.123160@l53g2000cwa.googlegroups.com...
>I would like to create a form in which a 2nd select box appears
> depending on the value selected in the 1st select box. The values of
> the 2nd select box will come from a database.
>
> My question is how to create this in php? One way is to re-load the
> page depending on what's chosen in the first box, or alternatively to
> use frames or an iframe?
>
> Is there another, better way that can dynamically change the initial
> page?

You could use Javascript to either
a) hide all select boxes except the one corresponding to the choice (by
editing the display property), and have the PHP script generate a SELECT for
each possible choice with "display: none" set by default
b) have the PHP generate a Javascript which will clear the second box and
re-fill it with the appropriate entries onChange of the first select

I think you need Javascript one way or another, if you want to get around
reloading the page (whether it be the main page or an (i)frame).

Regards

Michael

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация