How To Make City As Dropdown List For Shipping Address?

currently city is the input box for address.

How can make the city to dropdown list same as country and province?

So when select country popup the list of province, when select province popup the list of city for selection.



my cscart version is 3.0



we tried to add the city dropdown list and javascript in template to have the city dropdown list. but unfortunately it doesnot work. when select the province, the city list is not popped up as expected.

it looks like the new javascript conflicts with the existing implementation so it dosn't work.

I attached the javascript and template code here.

I am testing the page of update personal profile. the template file is skins\basic\customer\views\profiles\components\profile_fields.tpl

=========================================================

==========JS:





var select2 = new Array(9);

for (i=0; i<9; i++)

{

select2[i] = new Array();

}

//define the 3rd dorpdownlist for the city

select2[0][0] = new Option(“choose”, “00”);

select2[1][0] = new Option(“choose1”,“”);

select2[1][1] = new Option(“level 1”,“”);



select2[2][0] = new Option(“choose2”,“”);

select2[2][1] = new Option(“level 2”,“”);



select2[3][0] = new Option(“choose3”,“”);

select2[3][1] = new Option(“level 3”,“”);

select2[3][2] = new Option(“level 31”,“12”);

select2[3][3] = new Option(“level 32”,“13”);



select2[4][0] = new Option(“choose4”,“”);

select2[4][1] = new Option(“level 4”,“”);

select2[5][0] = new Option(“choose5”,“”);

select2[5][1] = new Option(“level 5”,“”);

select2[6][0] = new Option(“choose6”,“”);

select2[6][1] = new Option(“level 6”,“”);

select2[7][0] = new Option(“choose7”,“”);

select2[7][1] = new Option(“level 7”,“”);

select2[8][0] = new Option(“choose8”,“”);

select2[8][1] = new Option(“level 8”,“”);





function redirec(x)

{

var temp = document.profile_form.city;

for (i=0;i
{

temp.options[i]=new Option(select2[x][i].text,select2[x][i].value);

}

temp.options[0].selected=true;



}





====================template code:



{elseif $field.field_type == “A”} {* State selectbox }



- select city -

Unfortunately, there is no quick way to do it. Additional code modifications are required.

we tried to develop a javascript addon to have the city dropdown list. but unfortunately it doesnot work. when select the province, the city list is not popped up as expected.

it looks like the new javascript addon conflicts with the existing implementation so it dosn't work.

Anyone has the idea or experience to implement this?

I can provide more details if necessary. Thank you.

Please send us all details

update with the code

Dear Peter,



We are also at your service.

Contact us if you need our help.



Best regards, Alt-team.