473,795 Members | 2,924 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need to display subcategories based on categories with ajax

Hello,
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

Help appreciated
Jun 27 '08 #1
2 2665
On 3 Jun, 16:19, itpvision <itpvis...@gmai l.comwrote:
Hello,
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

Help appreciated
Why should there be any difference between an AJAX request and a
"classical" one? You control the request to the server in both cases.
Jun 27 '08 #2
itpvision wrote:
Hello,
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

Help appreciated
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.
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2472
by: Sofia | last post by:
My name is Sofia and I have for many years been running a personals site, together with my partner, on a non-profit basis. The site is currently not running due to us emigrating, but during its last year we got traffic of between 2000 - 2500 unique visitors per day. We are now about to re-launch the site from Sweden and we need to purchase a script to run it. Having looked at what is available on the net I have realised that we need a...
0
2252
by: Brian Murphy | last post by:
<?php /* I need your help. I'd be very thankfull if write me this script.I need a script that displays a list of categories and subcategories like this: <select name="category"> <option value="1">Main</option> <option value="2">Main > Computers</option> <option value="4">Main > Computers > Hardware </option>
2
3528
by: Troy Lynch | last post by:
I'm working on writing a website which I need to have lists of products listed in categories and subcategories, and need to keep track of whats in the tree. Like how many products from the root all the way down through the subcategories. I was thinking maybe in each category it would have a field which lists all the root categories. I hope this is a good explanation... it's kinda hard to explain I guess. I figure there were probably some...
4
13484
by: Brian Murphy | last post by:
I have a php-based yahoo-like web directory.I wanna give webmasters the possiblity to integrate my whole directory in their websites with their own formatting.I wanna this inclusion to be possible to all kinds of websites (ASP,PHP,... or just HTML).There are basically two files in my website: -index.php : shows the main categories along with 3 sample subcategories. -index1.php : displays the subcategories and sites of categories (exactly...
4
3240
by: Bill | last post by:
I've got a bookstore I'm developing, and I wanted to list all the categories on the home page of the site. However, there are so many, that they now extend way below the screen, making the page look sloppy. I want, therefore, to limit the number of categories on the home page, to a few general categores, then clicking on one will reveal the subcatgories underneath. How do I go about doing this? Thanks,
0
1206
by: Manuel | last post by:
If I have 2 tables CATEGORIES and PRODUCTS. What's the most "elegant" way (in programming terms) of displaying all the Categories with it's Products on a web page? I would like to show a list or table like: -Cat1 -----Product1 -----Product2 -----Product3
0
5828
by: M. David Johnson | last post by:
I cannot get my OleDbDataAdapter to update my database table from my local dataset table. The Knowledge Base doesn't seem to help - see item 10 below. I have a Microsoft Access 2000 database which indexes computer magazine articles for personal reference. I am developing a Visual Basic.NET program whose sole purpose is to enter new records into the database. No updates to existing entries, no deletions, and no display
7
3325
by: Dave | last post by:
Hello All, These one may be a bit tricky, and what I'd like to do may not even be possible. I would love to hear any ideas you guys have for solving this. Here is the situation: I have a form that displays the high-level data for a set of records in continuous forms mode. I have a simple command button that will open another form with the details of the selected record.
1
1445
dlite922
by: dlite922 | last post by:
We've built an application that deals with business management. One of the modules is an inventory/product management for a retail store. What I want to do is create a user friendly interface that allows them to easily navigate through the categories of item and choose a category or item to edit. What makes it complicated is that each customer has different level of categories (or none at all). Here's what my ideas are so far but...
0
9522
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10443
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10216
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10165
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10002
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9044
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7543
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6783
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
3
2921
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.