You can refer to this previous post regarding a similar issue
Joined: Dec 28, 2005
As per your communication, I have checked in google.com and found one convincing sample code. I have done some changes to pick from my database table as well. But still there is no luck. I am getting an error message. Here with attaching the sample code
The database table design is given already in my previous post. There is a java script error I am getting.. Error is also given below
Please help me to resolve the error.
Joined: Feb 22, 2005
For starters, I have no clue where you got that code from, but I think what you should have tried more is to understand how AJAX works instead of resorting to a simple Ctrl+C & Ctrl+V Anyways, some errors I can already point out are: 1) Are you even defining the method "getHttpObject()" anywhere? 2) xmlHttp.readyState=="complete" has no relevance. Infact it's not even correct. xmlHttp.readyState==4 (the first condition you use) is more like it. 3) You're not even checking whether the response status is correct (=200).
Before you start of implementing the cascaded dropdowns, it would hold you in good stead if you brushed up the fundamentals of AJAX. For starters, here's how your showState() method should have looked like:
Thereof, I think a tutorial like this will help you complete the remaning part easily.