ok

Mini Shell

Direktori : /home2/selectio/www/lilyexpresslive/software/admin/js/
Upload File :
Current File : /home2/selectio/www/lilyexpresslive/software/admin/js/validatePickupAdd.js

$(document).ready(function(){
        
          /***********    For fetching customer address and phone number ***********/
         $('#customer_id').on('change',function(){
           var cust_id=$(this).val();
           if(cust_id){
                $.ajax({
                  type:'POST',
                  url:'get_customer_data.php',
                  data:{id:cust_id},
                   dataType: 'json',
                  success:function(response){
                      var len = response.length;
                     $('textarea#address').val(response[0]['address']);
                      $('#phone').val(response[0]['mobile']);
                      $('#city').val(response[0]['city']);
                      $('#state').val(response[0]['state']);
                      $('#pincodes').val(response[0]['pincode']);
                      $('#destination').val(response[0]['destination']);
                      address_limit();
                    }
               });
           }
       });
    /***********    For fetching gst number ***********/
         $('#client_id').on('change',function(){
           var client_id=$(this).val();
           if(client_id){
                $.ajax({
                  type:'POST',
                  url:'get_client_data.php',
                  data:{id:client_id},
                   dataType: 'json',
                  success:function(response){
                      var len = response.length;
                      $('#gst').val(response[0]['gst']);
                  }
               });
           }
       });
      /***********    For fetching Customer ***********/             
    $('#client_id').on('change',function(){
          var client_id=$(this).val();
         //  alert(client_id);
           if(client_id){
                $.ajax({
                type:'POST',
                url:'get_client_selection.php',
                data:{id:client_id},
                success:function(html){
                    $('#customer_id').html(html);
    
                }
            }); 
           }
       });
    });
     $(document).ready(function(){
       $('#payment_mode').on('change',function(){
            var mode=$(this).val();
            if(mode=='credit')
            {
                $('#total_charges').val('credit');
                $('#other_charges').val('credit');
                $('#total_charges').prop('readonly', true);
                $('#other_charges').prop('readonly', true);
            }
             if(mode=='cash')
            {
                $('#total_charges').val('');
                $('#other_charges').val('');
                $('#total_charges').prop('readonly', false);
                $('#other_charges').prop('readonly', false);
            }
            
       });
    });
function formValidate() {
	var valid = 1;
	if ($('#client_id').val() == 'none') {
		$('#client_id_txt').text('Please select the Client');
		$('#client_id_txt').css('color', 'red');
		valid=0;
	} else {
		$('#client_id_txt').text('');
	}
	if ($('#customer_id').val() == 'none') {
		$('#customer_id_txt').text('Please select the Customer');
		$('#customer_id_txt').css('color', 'red');
		valid=0;
	} else {
		$('#customer_id_txt').text('');
	}
	if ($('#awb_value').val() == 'no') {
		$('#awb_txt').text('Please Enter Valid AWB Number');
		$('#awb_txt').css('color', 'red');
		valid=0;
	} else {
		$('#awb_txt').text('');
	}
	if ($('#pics').val() == '' || $('#pics').val()==0) {
		$('#awb_txt').text('Please Enter Number Of Box');
		$('#awb_txt').css('color', 'red');
		valid=0;
	} else {
		$('#awb_txt').text('');
	}
	
	return valid;
}

Zerion Mini Shell 1.0