Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
June 3, 2008, 3:19 pm
rate this thread
I have a link navigation of categories retrieved from the database,
while I know how to display subcategories based on category link
clicked with classical approach, I want to do this with ajax,
The problem is with the classical style,I know the GET['id'] sent and
the row im in with the category, so by simple comparison, I know how
to display the subcategories under its parent category, but with ajax,
I cannot know the GET and compare it, so the subcategories are
displaying under a different category
Re: Need to display subcategories based on categories with ajax
Why not? Have a js function that gets the value of the option which is
the category. Then have the url that it is sent to for php processing
apppend the ?cat=cat_value. Do the AJAX call with that url. In your
php code just do a $_GET['cat'] and you have the category. The do your
lookups and build the return.
Works for me.