<script type="text/javascript">

    $(function() {

       $('#client_id').change(function() {

           client_id = $('#client_id').val();

            $.get('<?php echo site_url('invoices/jquery_client_invoice_group'); ?>/' + client_id, {}, function(invoice_group_id) {
                $('#invoice_group_id').val(invoice_group_id);
            });

       });

    });

</script>