Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- getCities: function() {
- var stateElm = ($('#UserStateId').length > 0) ? $('#UserStateId') : $('#JobStateId');
- var cityElm = ($('#UserCityId').length > 0) ? $('select#UserCityId') : $('select#JobCityId');
- stateElm.change(function() {
- $.ajax({
- url:fullurl+'users/getcity/'+$(this).val(),
- beforeSend: function() {
- var loading = '<option value="">aguarde...</option>';
- cityElm.html(loading);
- },
- success: function(j) {
- var options = '';
- for (var i = 0; i < j.length; i++) {
- options += '<option value="' + j[i].id + '">' + j[i].nome + '</option>';
- }
- cityElm.html(options);
- },
- dataType:"json"
- });
- })
- },
Add Comment
Please, Sign In to add comment