Ignore:
Timestamp:
Mar 27, 2015 9:49:55 AM (10 years ago)
Author:
namnd
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pro-violet-viettel/sourcecode/assets/js/admin/user.js

    r818 r838  
    6060                success: function(data)
    6161                {
    62                    
    6362                        results = jQuery.parseJSON(data);
    64 
    6563                        $("#content-trade-histoty").html(results.modal);
    66 
    6764                }
    6865        });     
     
    9996        });
    10097}
     98
     99function checkSelecteDistrict(){
     100        provinceId = $(".form-field-province").val();
     101        $.ajax({
     102        url: '/frontend/user/getDistrict/' + provinceId,
     103        type: 'POST',
     104        success: function (data, textStatus, jqXHR)
     105        {
     106            result = jQuery.parseJSON(data);   
     107                        content = "";
     108                        if (result != null){
     109                                for (var i in result){
     110                                        if (result[i].district_id === district_id){
     111                                                content = content + '<option value="' + result[i].district_id + '" selected >' + result[i].type + " " + result[i].district_name + '</option>';
     112                                        }else{
     113                                                content = content + '<option value="' + result[i].district_id + '">' + result[i].type + " "  + result[i].district_name + '</option>';
     114                                        }
     115                                }
     116                                $(".form-field-district").html(content);
     117                        }
     118        }
     119    });
     120}
     121
     122function changeEventProvince(){
     123        $(".form-field-district").html("");
     124        provinceId = $("#form-field-province").val();
     125        $.ajax({
     126        url: '/frontend/user/getDistrict/' + provinceId,
     127        type: 'POST',
     128        success: function (data, textStatus, jqXHR)
     129        {
     130            result = jQuery.parseJSON(data);
     131                        content = "";
     132                        if (result != null){
     133                                for (var i in result){                 
     134                                        content = content + '<option value="' + result[i].district_id + '">'+ result[i].type + " "  + result[i].district_name + '</option>'
     135                                }
     136                                $(".form-field-district").html(content);
     137                        }
     138        }
     139    });
     140}
Note: See TracChangeset for help on using the changeset viewer.