I am using AJAX and JSONArray .
This is my requirement . I am having two select tags inside my jsp page . one for country and one for state .Upon selecting a country the select tag for states should be filled up .
In my jsp page , on body onload i am trying to get the data from DataBase and fill up the country select Tag .For this on body onload i am calling my servlet to get the countries list and keeping it in my JSONArray.
Please let me know inside my callback functionality in ajax how can i put this data inside my select option values .
I think, instead of wrapping the JSON response inside a <countries></countries> xml tag, just have this service return the JSON string of the array contents as type application/json
and then use a for loop to go over each item in this array and populate object tags within the select field.
Error: Keyboard not attached. Press F1 to continue.