Dynamic Drop Down

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Apr 2008
Posts: 1
Reputation: ikabod1973 is an unknown quantity at this point 
Solved Threads: 0
ikabod1973 ikabod1973 is offline Offline
Newbie Poster

Dynamic Drop Down

 
0
  #1
Apr 14th, 2008
Newbie to AJAX, I have recently used ajax for my validation handling, and I am planning to add a drop down menu for city and state. Both data are being pulled from two seperate tables in a mysql dbase. I have looked around for sample codes but havent found one that addresses this. Any help would be greatly appreciated.
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,651
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 474
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: Dynamic Drop Down

 
0
  #2
Apr 15th, 2008
You can always make two server trips and pull the required information one at a time. Another way would be to use JSON to pull in data in a single server trip by sending the data in the form:
{ city: ['C1', 'C2', 'C3'], state: ['S1', 'S2', 'S3'] } and interpreting it accordingly using Javascript.

All you need to know to successfully complete the above exercise is how to make an Ajax request which in itself is pretty simple; more so when using lightweight Ajax libraries like Ajax Toolbox.
I don't accept change; I don't deserve to live.

Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the JavaScript / DHTML / AJAX Forum


Views: 880 | Replies: 1
Thread Tools Search this Thread



Tag cloud for JavaScript / DHTML / AJAX
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC