function cargar_municipios(id_estado, url) { if(id_estado!='') { $('#municipio').show("300") $.ajax({ url: url, type: "GET", data: { id_estado: id_estado }, dataType: 'json', beforeSend: function(data) { $('#id_municipio').html(''); $('#id_localidad').html(''); }, success: function(data) { var options = ''; for (var i = 0; i < data.length; i++) { options += ''; } $('#id_municipio').html(options); $("#id_municipio option:first").attr('selected', 'selected'); } }); } else { $('#id_municipio').html(''); } $('#id_localidad').html(''); }; function cargar_parroquias(id_municipio, url) { if(id_municipio!='') { $('#parroquia').show("300") $.ajax({ url: url, type: "GET", data: { id_municipio: id_municipio }, dataType: 'json', beforeSend: function(data) { $('#id_localidad').html(''); }, success: function(data) { var options = ''; for (var i = 0; i < data.length; i++) { options += ''; } $('#id_localidad').html(options); $("#id_localidad option:first").attr('selected', 'selected'); } }); } else { $('#id_localidad').html(''); } }