var url = $('meta[name="base-url"]').attr('content');
 $.ajaxSetup({
  headers: {
    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
  }
});


$(document).ajaxStart(function() {
  $("#loading").fadeIn('200');
}).ajaxStop(function() {
  $("#loading").fadeOut('200');
});

var testEmail = /^[A-Z0-9._%+-]+@([A-Z0-9-]+\.)+[A-Z]{2,4}$/i;

$('#state').change(function(){
      var state = $(this).val();
      $.ajax({
        type:"get",
        url:url+"/getCity/"+state,
        success:function(res)
        {
          // console.log(res);
          var city = '';
          if(res.length>0)
          {
            city += '<option value="">Select</option>';
            for(var i=0;i<res.length;i++)
            {
              city += '<option value='+res[i].city_id+'>'+res[i].city+'</option>';
            }
          }
          $('#city').html(city);
        }
      });
});

