Hope this will help you .. +1 for this if you understand.
First step
//yours dynamic dropdown field
<select id="customers">
<option value="None Selected"></option>
<?PHP
$customers = $wpdb->get_results("SELECT * FROM _cif_customers_table;");
foreach ($customers as $customer) {
echo '<option value="'.$customer->id.'">'.$customer->company.'</option>';
}
?>
</select>
Second step :
//your customer data will show after fetch the data from customer table using ajax
<div class="col-lg-6">
<fieldset style="text-align:left;padding: 5px; border: 1px solid rgb(128,128,128);">
<legend>Sold To</legend>
<textarea id="text_area" style="resize:none;" rows="4" cols="50"></textarea>
</fieldset>
</div>
Third step :
//your ajax using on change function
<script>
$('#customers').on('change', function() {
//get the value
var customer_id = $(this).val();
/// run the ajax
$.ajax({
url: '<?php echo admin_url('admin-ajax.php'); ?>', //ajax url
type: 'post',
data: { action: 'customer_data', customer_id: customer_id }, // ajax parameters
success: function(data) {
$('#text_area').html( data ); // fetch data show on textarea
}
});
}
});
</script>
//function.php ajax
add_action('wp_ajax_customer_data' , 'customer_data'); //ajax parameter action
add_action('wp_ajax_nopriv_customer_data','customer_data');
function customer_data(){
$customer_id = $_POST['customer_id']; //id
//fetch the customer data here .....Your QUERY
//and return the values.
die;
}