Using a relate field in custom code

Hi,
I’m trying to make one very specific layout and use custom code to achieve this by putting all the fields together.
I’ve got it to work with fields including dropdown and checkboxes, however with relate fields it does not.

When I start typing it just does not start a quick search drop down. However, if I include these fields elsewhere on the edit page then these custom fields work, but do not save in chrome due to validation?..
Any ideas?

<input type="text" name="billing_contact" class="sqsEnabled yui-ac-input" tabindex="0" id="billing_contact" size="21" value="{$fields.billing_contact.value}" title="" autocomplete="off">
<input type="hidden" name="billing_contact_id" id="billing_contact_id" value="{$fields.billing_contact_id.value}">