Page 1 of 1
dyanmic drop down list (without my_sql)
Posted: Sat Apr 07, 2007 8:03 am
by imranali
Hey. What I need to do is, there's a dropdown list. When someone clicks something in the dropdown list, something happens.
for example:
country (field 1)
city (field 2)
If user selects country, city related to selected country should automatically come into city field.
I request to give me a little example here.
Posted: Sat Apr 07, 2007 8:06 am
by feyd
You're looking for a chained select. This is a client-side functionality, not PHP.
Search through our various boards for the phrase.
dyanmic drop down list (without my_sql)
Posted: Sat Apr 07, 2007 8:16 am
by imranali
feyd wrote:You're looking for a chained select. This is a client-side functionality, not PHP.
Search through our various boards for the phrase.
Sir, actually my english is also not good so may be not asked corretly.
i can give you a example
http://www.bestessays.com/order.php where when you'll select "TYPE OF DOCUMENT", some below fields data will be changed.
like if you'll select THESIS, "COST PER PAGE" will be changed.
can you kindly help me out. sir, i'm tyring for a week but still not got how to do.
pl help me.
Posted: Sat Apr 07, 2007 9:12 am
by aaronhall
As feyd was saying, this sort of functionality requires javascript.... search these forums for "chained select" or
check out google
Posted: Sat Apr 07, 2007 3:14 pm
by imranali
aaronhall wrote:As feyd was saying, this sort of functionality requires javascript.... search these forums for "chained select" or
check out google
isn't there any alternate way in PHP?
pl help me out.
Posted: Sat Apr 07, 2007 3:49 pm
by louie35
Posted: Tue Apr 10, 2007 3:25 am
by CoderGoblin
There are two ways of doing this...
1) Reload the page when the first "select" is changed either through javascript or a "find" button.
2) Load all possibilities and handle through javascript
2) Use Ajax (recommended) with fallback option. An example shown in
viewtopic.php?t=60287
Posted: Tue Apr 10, 2007 11:35 am
by RobertGonzalez
Using PHP to do this is simple, but it requires a trip to the server to do it. If you are ok with that, it is nothing more than offering a select list that, when submitted, uses the selected item to query the database and load another select list.