How to use AJAX to populate state list depending on Country list?

前端 未结 6 824
我在风中等你
我在风中等你 2020-12-06 15:01

I have the code below that will change a state dropdown list when you change the country list.
How can I make it change the state list ONLY when country ID number 234 an

6条回答
  •  [愿得一人]
    2020-12-06 15:33

    **index.html**
    
    
    
    
    Populate City Dropdown Using jQuery Ajax
    
    
    
    
    
    
    **ajaxServer.jsp** <% String count=request.getParameter("country"); String india[]={"Mumbai", "New Delhi", "Bangalore"}; String usa[]={"New Yourk", "Los Angeles","California"}; String uk[]={"London", "Manchester", "Liverpool"}; String states[]; if(count.equals("india")) { for(int i=0;i<=2;i++) { out.print(""); } } else if(count.equals("usa")) { for(int i=0;i"+usa[i]+""); } } else if(count.equals("uk")) { for(int i=0;i<=2;i++) { out.print(""); } } %>

提交回复
热议问题