I have found the error. The error is in your city data in the database. Some city name data has escape character i.e, " \ " .. which is destroying the json structure and your parser in jQuery is getting unable to parse the data.
There is two way to solve this...
- You can clean up the data from database .. that is you have to find those city name which has escape character and remove the escape character and save. Example: "Dhaka\" to "Dhaka".
OR
- You can use addslashes() PHP function in the ajax PHP file where you are making the select list option HTML. i.e,
$
city_list.="<
option value='$
row[id]'>".addslashes($
row['city_name'])."<
/option>";
...... Lets do what you prefer. But, my opinion to use 2nd option.
Cheers. .. :)