Hi guys...
Am creating a form in that am using two drop down list box's named category and subcategory
If i select an option from category drop down list, the corresponding values should show in the subcategory dropdown list...
I need to take both the values from database....
thanks in advance
Need Help: Drop down script like country- state
Moderator: General Moderators
-
rajsekar2u
- Forum Commoner
- Posts: 71
- Joined: Thu Nov 20, 2008 4:23 am
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: Need Help: Drop down script like country- state
Sounds like you have the right idea!
- jayshields
- DevNet Resident
- Posts: 1912
- Joined: Mon Aug 22, 2005 12:11 pm
- Location: Leeds/Manchester, England
Re: Need Help: Drop down script like country- state
You haven't posted a question. I'm assuming you just want us to make a script for you.
It can be done purely with PHP, if you don't mind damaging the user experience by requiring a page refresh after the first value has been chosen. Ideally, you'll want to use JavaScript, and possibly AJAX. I would stay away from AJAX for something this simple, and do it by fetching all the cats and subcats (this could become infeasible if you have a very large data set, and then you'd think about AJAX), and then just using Javascript to show the necessary subcats upon cat choice.
It can be done purely with PHP, if you don't mind damaging the user experience by requiring a page refresh after the first value has been chosen. Ideally, you'll want to use JavaScript, and possibly AJAX. I would stay away from AJAX for something this simple, and do it by fetching all the cats and subcats (this could become infeasible if you have a very large data set, and then you'd think about AJAX), and then just using Javascript to show the necessary subcats upon cat choice.
-
rajsekar2u
- Forum Commoner
- Posts: 71
- Joined: Thu Nov 20, 2008 4:23 am
Re: Need Help: Drop down script like country- state
No... Just want to know which method to use for this..
i tried javascript but i cant get the result...
i tried javascript but i cant get the result...