根据客户输入更新链接

I have the following input field :

<input data-type="customerName" value="<?php echo isset($invoice['Client']['customerName']) ? $invoice['Client']['customerName']: ''; ?>"  type="text" class="form-control" id="clientCompanyName" placeholder="Company Name">

When the user types in it, it utilizes autocomplete to pull data from my sql database and display names, and the user picks the name that is pulled from the database.

When the form is saved, the name, and the uuid is saved to the form. I have another code tidbit :

<a target="_blank" href="add-client.php?uuid=<?php echo isset($invoice['Client']['customeruuid']) ? $invoice['Client']['customeruuid']: ''; ?>">

This links to another page to update client information, but it only works after the form is saved.

I am trying to make the link work all the time, immediately after the user selects a customerName. Is there a way to do this?

I would strongly suggest you to go for the AngularJS way. You can use expressions to dynamically format your link.

Check this: http://www.w3schools.com/angular/angular_expressions.asp

<div ng-app="" ng-init="myName='Foo'">
<input type="text" ng-model="myName">
<a ng-href="http:\\www.{{myName}}.com">{{myName}}</a>

Substitute 'Foo' with your retrieval from the database and you may be good to go.

If you wanna test how it works, I did a JSFiddle: https://jsfiddle.net/ny39728p/

Yes, you need to use jquery and ajax, php code is run on the server when the page loads, it is not dynamically applied while the page is open. You need to use javascript or jquery to handle user input without reloading the page. If this user input needs to query a database, you will have to use a seperate php page, and access that information using $.ajax with jquery.