City list is loaded by changing State drop down. Every state is perfect except Texas. Texas have around 1500 data. it's the only reason why city drop down data is not populated for Texas. here is my code as zipped. Download
Asked
Active
Viewed 1,096 times
1 Answers
1
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. .. :)

ARiF
- 26
- 1
- 3
-
is there any way to pass special characters or / in json like xml ? – Raza Ahmed Sep 10 '13 at 04:41