Ability to manually assign "referred by" on affiliates?

I want the user to be able to select or enter an affiliate user on signing up so that they can give a referral credit to the affiliate.