Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- $(function() {
- $('#estadoMunicipio')
- .change(
- function() {
- if ($(this).val()) {
- $('#municipioEstado').hide();
- $('.carregando').show();
- $.getJSON('/nota-fiscal-servico-web/buscaMunicipioPorPaisEstado/' + $(this).val(),
- function(j) {
- var options = '<option value="" class="chosen-select">'
- +'</option>';
- for (var i = 0; i < j.length; i++) {
- options += '<option class="chosen-select" value="' +
- j[i].id + '">'
- + j[i].descricao
- + '</option>';
- }
- $('#municipioEstado')
- .html(options)
- .show();
- $('.carregando').hide();
- });
- } else {
- $('#municipioEstado')
- .html(
- '<option class="chosen-select" value="">-- Escolha um estado --</option>');
- }
- });
- });
- </script>
Add Comment
Please, Sign In to add comment