+ Start a Discussion
prady-cmprady-cm 

How can i hide the input box for a lookup?

I have a lookup field called account__c in my object. I am using this on my VF page using apex:inputField. I do get the inputbox as well as the magnifying class icon for me to select the accounts.

I want to hide the inputbox and only show the magnifying glass icon. User should be allowed to click on the icon and choose the account and value should be avialble on account__c .

I thought of hiding the inputbox using css. The id of the inputbox is

 Page1:Form:Pblock:pbSection:pbsiAccountName:ifAccountName_lkid

and the id for the icon is

Page1:Form:Pblock:pbSection:pbsiAccountName:ifAccountName_lkwgt

Note : the Id of account is ifAccountName in Vf page, the '_lkid' and _lkwgt are generated when i view the pagesource. I also have a style tag defined in my Vf page just below the tag

<style> 
#leadConversionPage:leadConversionForm:pBConvertLead:pbSectionLeadSection:pbsiAccountName:ifAccountName_lkid
{
display:none;
}
</style>

This still doesnt hide the inputbox. Cant seem to figure out what is causing the input box to visible. does any one have a better way of hiding the input box

Andres AndradeAndres Andrade

Hi prady-cm,

You can try this:

<style>

   #inputFieldWrapper input{
                display: none;
   }
</style>



<div id="inputFieldWrapper">
    <apex:inputField id="myInputField" value="" />
</div>

See if that helps.

Andres