Ok, this is my very first attempt at Ajax and its driving me insane as I really cant get my head round it. What im trying to do is populate the first box with the customers
Maybe try live instead of on. It is deprecated but I found out is more likely to work when element is not loaded.
live
on
$$('#customer').on('change', function (){
changed to
$('#customer').live('change', function (){