Re: Basic PHP/HTML code question
| From: | tg-php at gryffyndevelopment dot com | Date: | Wed, 18 May 2005 13:54:04 +0000 |
| Subject: | Re: Basic PHP/HTML code question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-215472@lists.php.net to get a copy of this message | ||
Since PHP is server-side, it's probably not the best option for doing what you're
describing. It IS possible to use a javascript "onchange" event and use that to trigger a
new page load which would change your second select box, but that's kind of slow and sloppy and
should probably only be used when your select boxes have a LOT of data or can change a lot
necessitating a database lookup on whatever you selected in the first box.
It sounds like what you want to do would best be done in javascript totally. Use PHP to build the
javascript code that has all the options and then use code like the stuff found in Example 1 on:
http://www.mattkruse.com/javascript/dynamicoptionlist/
Technically this message is "off topic" and I'm sure someone will say something about
it, but I hope people remember when they were starting out in PHP and weren't sure what it
could and couldn't do and remember that asking questions like this is part of the learning
process.
Best of luck Carlos!
-TG
= = = Original message = = =
Hi,
I have been trying to write or find a pre-written script of a combo-box which would
allow one to select a category from one drop-down list, then be given related options
within a secondary list before clicking a submit button. Is there anyone who knows
where I can find this or an easy way to accomplish this in PHP?
Sorry if this is a basic question but I have only begun learning coding PHP so some
items are foreign at this point. Thanks for your understanding and any assistance.
C.
___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.