Changeset 838 for pro-violet-viettel/sourcecode/assets/js/frontend/user.js
- Timestamp:
- Mar 27, 2015 9:49:55 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/assets/js/frontend/user.js
r820 r838 1 1 function updateInfo(us_id) { 2 2 $.ajax({ 3 url: ' update_user/' + us_id,3 url: '/frontend/user/update_user/' + us_id, 4 4 type: 'POST', 5 5 data: $("#frm1").serialize(), … … 42 42 $("#account-info-tab").click(); 43 43 }); 44 45 46 if ($(".form-field-province").val() !== 'undefined'){ 47 checkSelecteDistrict(); 48 } 49 $(".form-field-province").change(function(){ 50 changeEventProvince(); 51 }); 52 53 54 44 55 $("#finish_package_register").click(function () { 45 56 finish_package_register(); … … 274 285 return x1 + x2; 275 286 } 287 288 function checkSelecteDistrict(){ 289 provinceId = $(".form-field-province").val(); 290 $.ajax({ 291 url: '/frontend/user/getDistrict/' + provinceId, 292 type: 'POST', 293 success: function (data, textStatus, jqXHR) 294 { 295 result = jQuery.parseJSON(data); 296 content = ""; 297 if (result != null){ 298 for (var i in result){ 299 if (result[i].district_id === district_id){ 300 content = content + '<option value="' + result[i].district_id + '" selected >' + result[i].type + " " + result[i].district_name + '</option>'; 301 }else{ 302 content = content + '<option value="' + result[i].district_id + '">' + result[i].type + " " + result[i].district_name + '</option>'; 303 } 304 } 305 $(".form-field-district").html(content); 306 } 307 } 308 }); 309 } 310 311 if ($(".form-field-province").val() !== 'undefined'){ 312 checkSelecteDistrict(); 313 } 314 315 function changeEventProvince(){ 316 $(".form-field-district").html(""); 317 provinceId = $("#form-field-province").val(); 318 $.ajax({ 319 url: '/frontend/user/getDistrict/' + provinceId, 320 type: 'POST', 321 success: function (data, textStatus, jqXHR) 322 { 323 result = jQuery.parseJSON(data); 324 content = ""; 325 if (result != null){ 326 for (var i in result){ 327 content = content + '<option value="' + result[i].district_id + '">'+ result[i].type + " " + result[i].district_name + '</option>' 328 } 329 $(".form-field-district").html(content); 330 } 331 } 332 }); 333 } 334 335 $(".form-field-province").change(function(){ 336 changeEventProvince(); 337 });
Note: See TracChangeset
for help on using the changeset viewer.