Select the country will decide cities list in second dropdown list.
https://jsfiddle.net/k18etgex/11/
It works with countries name which is one word such as "Úc", "Pháp", "Mỹ".
var Úc = [
{display: "Canberra", value: "Canberra" },
{display: "Sydney", value: "Sydney" },
{display: "Melbourne", value: "Melbourne" },
{display: "Perth", value: "Perth" },
{display: "Gold Coast ", value: "Gold-Coast" }];
var Pháp = [
{display: "Paris", value: "Paris" },
{display: "Avignon", value: "Avignon" },
{display: "Strasbourg", value: "Strasbourg" },
{display: "Nice", value: "Nice" }];
But it does not work with country which name is two word such as "Nhật Bản"
var Nhật Bản = [
{display: "Tokyo", value: "Tokyo" },
{display: "Osaka", value: "Osaka" }
];
AND I am not allowed to change anything of first dropdown box.
Country:
<select name="departure_country[]" data-required="1" data-type="select">
<option value="">- Chọn nước -</option>
<option value="Mỹ">Mỹ</option> <option value="Úc">Úc</option> <option value="Pháp">Pháp</option>
<option value="Nhật Bản">Nhật Bản</option>
</select>
How to fix this problem?
var Nhật_BảnRead: A JavaScript identifier must start with a letter, underscore (_), or dollar sign ($); subsequent characters can also be digits (0-9). Because JavaScript is case sensitive, letters include the characters "A" through "Z" (uppercase) and the characters "a" through "z" (lowercase).<option value="Nhật Bản">is a value, not a variable name. Don't use that value to a variable name ....