Is there any way I can create a field that mimics a lookup field in Salesforce?

When using the default contact fields in a visualforce, Salesforce injects lots of their own custom styling which I'm struggling to get rid of.

Is there a way I can roll my own lookup field which I can style entirely myself via CSS?

The following code:

        <!-- This field is bound to an object in the controller -->            
        <apex:inputField value="{!newCase.ContactId}" styleClass="form-control"  />

Produces a span in HTML with a tag and an tag which is the clickable magnifying glass logo. How can I apply a seperate CSS class to each of these?

1 Answer 1


Below Link might help you. I have done it once with the help of this.

Custom Lookup-VF

You must log in to answer this question.