Returned input not inserting into a field

Returned input not inserting into a field

Hello,

This morning I wrote a small script to look up the ID of the users selection and put the result into another field on an on click [create] button.
My returned information will display in the alert box i added to check, but the returned value in not being placed into
the field... at least not that a user can see.

Any thoughts would be greatly appreciated.

Here is the code.

// Match the Customer Information with the users selection.
//
ThisSite  =  Customer_Info  [ID = input.Select_Site];
//
alert("Selected Site is " + ThisSite.Site_ID);
input.Site_ID = ThisSite.Site_ID;

Let me add a bit more information.

This code is in a stateless form under an on click event. To test it I moved the code to the field actions> on user input and it works there.