/    Sign up×
Community /Pin to ProfileBookmark

an issue with the drop down box

hello everybody,

i am trying to learn php on my own and i have an issue with the drop down box in php. i would like to use 3 drop down boxes one for the state, second for the district and the third for the pincode.

when the page loads for the first time then only one drop down should be present and when the user selects any state then one more should appear automatically with the list of districts in that state and when the user selects the district then one more drop down should appear with the different pincodes available for that district.

like this it should be done automatically and should be visible only one after the other and the values should remain same in the drop down boxes.

if you do not understand this then you can imagine the selection of the category and sub category in any forum or journals.

so can any one guide me the process how can that be done.

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@themartyMay 08.2009 — First of all: what you want can not be done with PHP, unless you don't mind that the page reloads everytime the user selects an option. Without a page reload you'll have to solve this with javascript and you should therefor be in the javascript forum.

Aside from that: what you want has been done so many times do, that it should be fairly easy to find an example online. Sites like hotscripts.com and scripts.com probably also have scripts that you can download

btw, First hit in google exactly demonstrates what you want:

http://www.google.com/search?q=dynamic+drop-down
×

Success!

Help @swathin2 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...