0

Good Evening everyone, sorry for any english mistakes first.

I got a working jquery chosen plugin populate with my field 'estado'(or province).

What i need is to populate another jquery chosen plugin with the respective cities of that state(province, not sure about the term anyway...).

This must be done using ajax, and php server side script

I found this topic, but dont match my needs since i'm new at jquery and jquery chose

Jquery Chosen plugin - dynamically populate list by Ajax

heres the picture of my page enter image description here

So basicaly thats it i need to populate the second ul fields with data

heres a terrible fiddle of the plain html code if anyone can find helpful

Link to the fail JS Fiddle

Community
  • 1
  • 1
  • I found the answer for you on another post. http://stackoverflow.com/questions/18441364/chaining-selects-with-chosen – user2909855 Dec 17 '13 at 08:33
  • I found an even better one here, it uses a country example with states http://jsfiddle.net/mikeys4u/ep37owwr/9/ which I found in stackoverflow somewhere else... – Mikeys4u Oct 31 '15 at 00:30

1 Answers1

0

I think its pretty simple,

something similar to Country - State dropdown , my suggestion is first dropdown like country you already created with chosen by changing the dropdown values call an ajax and populate the entire State dropdown(Second one) this should be normal select box not apply chosen class to it. then simply apply chosen via jQuery like below.

jQuery('#state').chosen();// this should inside your success ajax function

This way you can simply integrate a chosen with ajax.

Hope its helps..

Jobin
  • 8,238
  • 1
  • 33
  • 52