Generating chained dynamic drop downs using ajax and java script












1















I am trying to do the cascading drop down in country,state and city .



In this my problem is,country drop down shows the thous values, but country related states are not showing in the state drop down and as well city also.



I am trying in the spring tool suits.



my problem is that country drop down shows the thous values, but country related states are not showing in the state drop down and as well city also.



    index.jsp

<%@page import="java.sql.*" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Dynamic Dependent Select Box Using jQuery, Ajax & JSP with MySql</title>
<script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>

<script type="text/javascript">
function country_change()
{
var x = document.getElementById("country").selectedIndex;
alert(document.getElementsByTagName("option")[x].value);

debugger;
var country = $(".country").val();

$.ajax({
type: "GET",
url: "state.jsp",
data: "country_id="+country,

cache: false,
success: function(response)

{

$(".state").html(response);
}
});
}
function state_change()
{
var state = $(".state").val();

$.ajax({
type: "GET",
url: "city.jsp",
data: "state_id="+state,

cache: false,
success: function(response)
{
$(".city").html(response);
}
});
}
</script>

<style>
label
{
font-weight:bold;
padding:10px;
}
div
{
margin-top:100px;
}
select
{
width:200px;
height:35px;
}
</style>

</head>

<body>

<center>
<div>

<label>Country :</label>
<select id="country" onclick="country_change()">
<option selected="selected">--Select Country--</option>

<%
try
{
Class.forName("com.mysql.jdbc.Driver"); //load driver
Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/dynamic_db","root","root"); //create connection

PreparedStatement pstmt=null ; //create statement

pstmt=con.prepareStatement("select country_id,country_name from country"); //sql select query

ResultSet rs=pstmt.executeQuery(); //execute query and set in resultset object rs.

while(rs.next())
{
%>
<option value="<%=rs.getInt("country_id")%>">

<%=rs.getString("country_name")%>
</option>

<%


}

con.close(); //close connection
}
catch(Exception e)
{
out.println(e);
}
%>
</select>

<label>State :</label>
<select class="state" onchange="state_change()">
<option selected="selected">--Select State--</option>
</select>

<label>City :</label>
<select class="city">
<option selected="selected">--Select City--</option>
</select>

</div>
<br />

</center>

</body>
</html>



state.jsp

<%@page import="java.sql.*" %>

<%
if(request.getParameter("country_id")!=null)
{
int id=Integer.parseInt(request.getParameter("country_id")); //get country_id from index.jsp page with function country_change() through ajax and store in id variable
System.out.println(id+"country");
try
{
Class.forName("com.mysql.jdbc.Driver"); //load driver
Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/dynamic_db","root","root"); //create connection

PreparedStatement pstmt=null ; //create statement

pstmt=con.prepareStatement("select state_id,state_name,country_id from state where country_id=?"); //sql select query
pstmt.setInt(1,id);
ResultSet rs=pstmt.executeQuery(); //execute query and set in resultset object rs.
%>
<option selected="selected">--Select State--</option>
<%
while(rs.next())
{
%>
<option value="<%=rs.getInt("state_id")%>">
<%=rs.getString("state_name")%>
</option>
<%

}

con.close(); //close connection
}
catch(Exception e)
{
out.println(e);
}
}
%>

city.jsp

<%@page import="java.sql.*" %>

<%
if(request.getParameter("state_id")!=null)
{
int id=Integer.parseInt(request.getParameter("state_id")); //get state_id from index.jsp page with function state_change() through ajax and store in id variable.

try
{
Class.forName("com.mysql.jdbc.Driver"); //load driver
Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/dynamic_db","root","root"); //create connection

PreparedStatement pstmt=null ; //create statement

pstmt=con.prepareStatement("select * from city where state_id=? "); //sql select query
pstmt.setInt(1,id);
ResultSet rs=pstmt.executeQuery(); //execute query and set in resultset object rs.
%>
<option selected="selected">--Select City--</option>
<%
while(rs.next())
{
%>
<option value="<%=rs.getInt("city_id")%>">
<%=rs.getString("city_name")%>
</option>
<%
}

con.close(); //close connection
}
catch(Exception e)
{
out.println(e);
}
}
%>


I expects the output in when ever select country in country drop down automatically shows the selected country related states and state related city's in drop down.



But the actual output show the only country in country's drop down, whenever the select the country in country's drop down , the country related state are not displayed in the state drop down.



the database table's details are: country,state and city.



country table:



 1.country_id(pk)
2.Country_name.


state table:



1.state_id (pk).
2.state_name.
3.country_id (fk).


city table:



1.city_id (pk).
2.city_name.
3.state_id (fk).


thous are the database table fields.



I am also try the normally cascading drop down its work, but i am trying to fetch the values from database, it's not working .



It's showing the only the country's values ,the country related states and state related city's not fetching .



In database three tables are the relationship using the primary key and foreign key.
But shows the only country's values in the country drop down.



I don't know what I am doing wrong here so can you help me?



I want to create a cascading drop-down menu and I can't see what I am doing wrong. I've tried everything. I am just out of ideas.



please provide the solution.



Thank you










share|improve this question





























    1















    I am trying to do the cascading drop down in country,state and city .



    In this my problem is,country drop down shows the thous values, but country related states are not showing in the state drop down and as well city also.



    I am trying in the spring tool suits.



    my problem is that country drop down shows the thous values, but country related states are not showing in the state drop down and as well city also.



        index.jsp

    <%@page import="java.sql.*" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Dynamic Dependent Select Box Using jQuery, Ajax & JSP with MySql</title>
    <script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>

    <script type="text/javascript">
    function country_change()
    {
    var x = document.getElementById("country").selectedIndex;
    alert(document.getElementsByTagName("option")[x].value);

    debugger;
    var country = $(".country").val();

    $.ajax({
    type: "GET",
    url: "state.jsp",
    data: "country_id="+country,

    cache: false,
    success: function(response)

    {

    $(".state").html(response);
    }
    });
    }
    function state_change()
    {
    var state = $(".state").val();

    $.ajax({
    type: "GET",
    url: "city.jsp",
    data: "state_id="+state,

    cache: false,
    success: function(response)
    {
    $(".city").html(response);
    }
    });
    }
    </script>

    <style>
    label
    {
    font-weight:bold;
    padding:10px;
    }
    div
    {
    margin-top:100px;
    }
    select
    {
    width:200px;
    height:35px;
    }
    </style>

    </head>

    <body>

    <center>
    <div>

    <label>Country :</label>
    <select id="country" onclick="country_change()">
    <option selected="selected">--Select Country--</option>

    <%
    try
    {
    Class.forName("com.mysql.jdbc.Driver"); //load driver
    Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/dynamic_db","root","root"); //create connection

    PreparedStatement pstmt=null ; //create statement

    pstmt=con.prepareStatement("select country_id,country_name from country"); //sql select query

    ResultSet rs=pstmt.executeQuery(); //execute query and set in resultset object rs.

    while(rs.next())
    {
    %>
    <option value="<%=rs.getInt("country_id")%>">

    <%=rs.getString("country_name")%>
    </option>

    <%


    }

    con.close(); //close connection
    }
    catch(Exception e)
    {
    out.println(e);
    }
    %>
    </select>

    <label>State :</label>
    <select class="state" onchange="state_change()">
    <option selected="selected">--Select State--</option>
    </select>

    <label>City :</label>
    <select class="city">
    <option selected="selected">--Select City--</option>
    </select>

    </div>
    <br />

    </center>

    </body>
    </html>



    state.jsp

    <%@page import="java.sql.*" %>

    <%
    if(request.getParameter("country_id")!=null)
    {
    int id=Integer.parseInt(request.getParameter("country_id")); //get country_id from index.jsp page with function country_change() through ajax and store in id variable
    System.out.println(id+"country");
    try
    {
    Class.forName("com.mysql.jdbc.Driver"); //load driver
    Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/dynamic_db","root","root"); //create connection

    PreparedStatement pstmt=null ; //create statement

    pstmt=con.prepareStatement("select state_id,state_name,country_id from state where country_id=?"); //sql select query
    pstmt.setInt(1,id);
    ResultSet rs=pstmt.executeQuery(); //execute query and set in resultset object rs.
    %>
    <option selected="selected">--Select State--</option>
    <%
    while(rs.next())
    {
    %>
    <option value="<%=rs.getInt("state_id")%>">
    <%=rs.getString("state_name")%>
    </option>
    <%

    }

    con.close(); //close connection
    }
    catch(Exception e)
    {
    out.println(e);
    }
    }
    %>

    city.jsp

    <%@page import="java.sql.*" %>

    <%
    if(request.getParameter("state_id")!=null)
    {
    int id=Integer.parseInt(request.getParameter("state_id")); //get state_id from index.jsp page with function state_change() through ajax and store in id variable.

    try
    {
    Class.forName("com.mysql.jdbc.Driver"); //load driver
    Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/dynamic_db","root","root"); //create connection

    PreparedStatement pstmt=null ; //create statement

    pstmt=con.prepareStatement("select * from city where state_id=? "); //sql select query
    pstmt.setInt(1,id);
    ResultSet rs=pstmt.executeQuery(); //execute query and set in resultset object rs.
    %>
    <option selected="selected">--Select City--</option>
    <%
    while(rs.next())
    {
    %>
    <option value="<%=rs.getInt("city_id")%>">
    <%=rs.getString("city_name")%>
    </option>
    <%
    }

    con.close(); //close connection
    }
    catch(Exception e)
    {
    out.println(e);
    }
    }
    %>


    I expects the output in when ever select country in country drop down automatically shows the selected country related states and state related city's in drop down.



    But the actual output show the only country in country's drop down, whenever the select the country in country's drop down , the country related state are not displayed in the state drop down.



    the database table's details are: country,state and city.



    country table:



     1.country_id(pk)
    2.Country_name.


    state table:



    1.state_id (pk).
    2.state_name.
    3.country_id (fk).


    city table:



    1.city_id (pk).
    2.city_name.
    3.state_id (fk).


    thous are the database table fields.



    I am also try the normally cascading drop down its work, but i am trying to fetch the values from database, it's not working .



    It's showing the only the country's values ,the country related states and state related city's not fetching .



    In database three tables are the relationship using the primary key and foreign key.
    But shows the only country's values in the country drop down.



    I don't know what I am doing wrong here so can you help me?



    I want to create a cascading drop-down menu and I can't see what I am doing wrong. I've tried everything. I am just out of ideas.



    please provide the solution.



    Thank you










    share|improve this question



























      1












      1








      1








      I am trying to do the cascading drop down in country,state and city .



      In this my problem is,country drop down shows the thous values, but country related states are not showing in the state drop down and as well city also.



      I am trying in the spring tool suits.



      my problem is that country drop down shows the thous values, but country related states are not showing in the state drop down and as well city also.



          index.jsp

      <%@page import="java.sql.*" %>

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
      <title>Dynamic Dependent Select Box Using jQuery, Ajax & JSP with MySql</title>
      <script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>

      <script type="text/javascript">
      function country_change()
      {
      var x = document.getElementById("country").selectedIndex;
      alert(document.getElementsByTagName("option")[x].value);

      debugger;
      var country = $(".country").val();

      $.ajax({
      type: "GET",
      url: "state.jsp",
      data: "country_id="+country,

      cache: false,
      success: function(response)

      {

      $(".state").html(response);
      }
      });
      }
      function state_change()
      {
      var state = $(".state").val();

      $.ajax({
      type: "GET",
      url: "city.jsp",
      data: "state_id="+state,

      cache: false,
      success: function(response)
      {
      $(".city").html(response);
      }
      });
      }
      </script>

      <style>
      label
      {
      font-weight:bold;
      padding:10px;
      }
      div
      {
      margin-top:100px;
      }
      select
      {
      width:200px;
      height:35px;
      }
      </style>

      </head>

      <body>

      <center>
      <div>

      <label>Country :</label>
      <select id="country" onclick="country_change()">
      <option selected="selected">--Select Country--</option>

      <%
      try
      {
      Class.forName("com.mysql.jdbc.Driver"); //load driver
      Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/dynamic_db","root","root"); //create connection

      PreparedStatement pstmt=null ; //create statement

      pstmt=con.prepareStatement("select country_id,country_name from country"); //sql select query

      ResultSet rs=pstmt.executeQuery(); //execute query and set in resultset object rs.

      while(rs.next())
      {
      %>
      <option value="<%=rs.getInt("country_id")%>">

      <%=rs.getString("country_name")%>
      </option>

      <%


      }

      con.close(); //close connection
      }
      catch(Exception e)
      {
      out.println(e);
      }
      %>
      </select>

      <label>State :</label>
      <select class="state" onchange="state_change()">
      <option selected="selected">--Select State--</option>
      </select>

      <label>City :</label>
      <select class="city">
      <option selected="selected">--Select City--</option>
      </select>

      </div>
      <br />

      </center>

      </body>
      </html>



      state.jsp

      <%@page import="java.sql.*" %>

      <%
      if(request.getParameter("country_id")!=null)
      {
      int id=Integer.parseInt(request.getParameter("country_id")); //get country_id from index.jsp page with function country_change() through ajax and store in id variable
      System.out.println(id+"country");
      try
      {
      Class.forName("com.mysql.jdbc.Driver"); //load driver
      Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/dynamic_db","root","root"); //create connection

      PreparedStatement pstmt=null ; //create statement

      pstmt=con.prepareStatement("select state_id,state_name,country_id from state where country_id=?"); //sql select query
      pstmt.setInt(1,id);
      ResultSet rs=pstmt.executeQuery(); //execute query and set in resultset object rs.
      %>
      <option selected="selected">--Select State--</option>
      <%
      while(rs.next())
      {
      %>
      <option value="<%=rs.getInt("state_id")%>">
      <%=rs.getString("state_name")%>
      </option>
      <%

      }

      con.close(); //close connection
      }
      catch(Exception e)
      {
      out.println(e);
      }
      }
      %>

      city.jsp

      <%@page import="java.sql.*" %>

      <%
      if(request.getParameter("state_id")!=null)
      {
      int id=Integer.parseInt(request.getParameter("state_id")); //get state_id from index.jsp page with function state_change() through ajax and store in id variable.

      try
      {
      Class.forName("com.mysql.jdbc.Driver"); //load driver
      Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/dynamic_db","root","root"); //create connection

      PreparedStatement pstmt=null ; //create statement

      pstmt=con.prepareStatement("select * from city where state_id=? "); //sql select query
      pstmt.setInt(1,id);
      ResultSet rs=pstmt.executeQuery(); //execute query and set in resultset object rs.
      %>
      <option selected="selected">--Select City--</option>
      <%
      while(rs.next())
      {
      %>
      <option value="<%=rs.getInt("city_id")%>">
      <%=rs.getString("city_name")%>
      </option>
      <%
      }

      con.close(); //close connection
      }
      catch(Exception e)
      {
      out.println(e);
      }
      }
      %>


      I expects the output in when ever select country in country drop down automatically shows the selected country related states and state related city's in drop down.



      But the actual output show the only country in country's drop down, whenever the select the country in country's drop down , the country related state are not displayed in the state drop down.



      the database table's details are: country,state and city.



      country table:



       1.country_id(pk)
      2.Country_name.


      state table:



      1.state_id (pk).
      2.state_name.
      3.country_id (fk).


      city table:



      1.city_id (pk).
      2.city_name.
      3.state_id (fk).


      thous are the database table fields.



      I am also try the normally cascading drop down its work, but i am trying to fetch the values from database, it's not working .



      It's showing the only the country's values ,the country related states and state related city's not fetching .



      In database three tables are the relationship using the primary key and foreign key.
      But shows the only country's values in the country drop down.



      I don't know what I am doing wrong here so can you help me?



      I want to create a cascading drop-down menu and I can't see what I am doing wrong. I've tried everything. I am just out of ideas.



      please provide the solution.



      Thank you










      share|improve this question
















      I am trying to do the cascading drop down in country,state and city .



      In this my problem is,country drop down shows the thous values, but country related states are not showing in the state drop down and as well city also.



      I am trying in the spring tool suits.



      my problem is that country drop down shows the thous values, but country related states are not showing in the state drop down and as well city also.



          index.jsp

      <%@page import="java.sql.*" %>

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
      <title>Dynamic Dependent Select Box Using jQuery, Ajax & JSP with MySql</title>
      <script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>

      <script type="text/javascript">
      function country_change()
      {
      var x = document.getElementById("country").selectedIndex;
      alert(document.getElementsByTagName("option")[x].value);

      debugger;
      var country = $(".country").val();

      $.ajax({
      type: "GET",
      url: "state.jsp",
      data: "country_id="+country,

      cache: false,
      success: function(response)

      {

      $(".state").html(response);
      }
      });
      }
      function state_change()
      {
      var state = $(".state").val();

      $.ajax({
      type: "GET",
      url: "city.jsp",
      data: "state_id="+state,

      cache: false,
      success: function(response)
      {
      $(".city").html(response);
      }
      });
      }
      </script>

      <style>
      label
      {
      font-weight:bold;
      padding:10px;
      }
      div
      {
      margin-top:100px;
      }
      select
      {
      width:200px;
      height:35px;
      }
      </style>

      </head>

      <body>

      <center>
      <div>

      <label>Country :</label>
      <select id="country" onclick="country_change()">
      <option selected="selected">--Select Country--</option>

      <%
      try
      {
      Class.forName("com.mysql.jdbc.Driver"); //load driver
      Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/dynamic_db","root","root"); //create connection

      PreparedStatement pstmt=null ; //create statement

      pstmt=con.prepareStatement("select country_id,country_name from country"); //sql select query

      ResultSet rs=pstmt.executeQuery(); //execute query and set in resultset object rs.

      while(rs.next())
      {
      %>
      <option value="<%=rs.getInt("country_id")%>">

      <%=rs.getString("country_name")%>
      </option>

      <%


      }

      con.close(); //close connection
      }
      catch(Exception e)
      {
      out.println(e);
      }
      %>
      </select>

      <label>State :</label>
      <select class="state" onchange="state_change()">
      <option selected="selected">--Select State--</option>
      </select>

      <label>City :</label>
      <select class="city">
      <option selected="selected">--Select City--</option>
      </select>

      </div>
      <br />

      </center>

      </body>
      </html>



      state.jsp

      <%@page import="java.sql.*" %>

      <%
      if(request.getParameter("country_id")!=null)
      {
      int id=Integer.parseInt(request.getParameter("country_id")); //get country_id from index.jsp page with function country_change() through ajax and store in id variable
      System.out.println(id+"country");
      try
      {
      Class.forName("com.mysql.jdbc.Driver"); //load driver
      Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/dynamic_db","root","root"); //create connection

      PreparedStatement pstmt=null ; //create statement

      pstmt=con.prepareStatement("select state_id,state_name,country_id from state where country_id=?"); //sql select query
      pstmt.setInt(1,id);
      ResultSet rs=pstmt.executeQuery(); //execute query and set in resultset object rs.
      %>
      <option selected="selected">--Select State--</option>
      <%
      while(rs.next())
      {
      %>
      <option value="<%=rs.getInt("state_id")%>">
      <%=rs.getString("state_name")%>
      </option>
      <%

      }

      con.close(); //close connection
      }
      catch(Exception e)
      {
      out.println(e);
      }
      }
      %>

      city.jsp

      <%@page import="java.sql.*" %>

      <%
      if(request.getParameter("state_id")!=null)
      {
      int id=Integer.parseInt(request.getParameter("state_id")); //get state_id from index.jsp page with function state_change() through ajax and store in id variable.

      try
      {
      Class.forName("com.mysql.jdbc.Driver"); //load driver
      Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/dynamic_db","root","root"); //create connection

      PreparedStatement pstmt=null ; //create statement

      pstmt=con.prepareStatement("select * from city where state_id=? "); //sql select query
      pstmt.setInt(1,id);
      ResultSet rs=pstmt.executeQuery(); //execute query and set in resultset object rs.
      %>
      <option selected="selected">--Select City--</option>
      <%
      while(rs.next())
      {
      %>
      <option value="<%=rs.getInt("city_id")%>">
      <%=rs.getString("city_name")%>
      </option>
      <%
      }

      con.close(); //close connection
      }
      catch(Exception e)
      {
      out.println(e);
      }
      }
      %>


      I expects the output in when ever select country in country drop down automatically shows the selected country related states and state related city's in drop down.



      But the actual output show the only country in country's drop down, whenever the select the country in country's drop down , the country related state are not displayed in the state drop down.



      the database table's details are: country,state and city.



      country table:



       1.country_id(pk)
      2.Country_name.


      state table:



      1.state_id (pk).
      2.state_name.
      3.country_id (fk).


      city table:



      1.city_id (pk).
      2.city_name.
      3.state_id (fk).


      thous are the database table fields.



      I am also try the normally cascading drop down its work, but i am trying to fetch the values from database, it's not working .



      It's showing the only the country's values ,the country related states and state related city's not fetching .



      In database three tables are the relationship using the primary key and foreign key.
      But shows the only country's values in the country drop down.



      I don't know what I am doing wrong here so can you help me?



      I want to create a cascading drop-down menu and I can't see what I am doing wrong. I've tried everything. I am just out of ideas.



      please provide the solution.



      Thank you







      jquery mysql ajax






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 3 at 14:43









      SHR

      6,05872544




      6,05872544










      asked Jan 3 at 14:07









      Srinivasarao JellaSrinivasarao Jella

      61




      61
























          0






          active

          oldest

          votes












          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54023928%2fgenerating-chained-dynamic-drop-downs-using-ajax-and-java-script%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54023928%2fgenerating-chained-dynamic-drop-downs-using-ajax-and-java-script%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Monofisismo

          Angular Downloading a file using contenturl with Basic Authentication

          Olmecas