function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
JayaJayaJayaJaya 

VF Issue : Lookup field in vf is displaying no gab between two input boxes

Hi,
We are facing issue with alignment/spacing for lookup fields in Vf.

VF page is as below:

<apex:page standardController="Task">
<apex:form >
    <apex:pageBlock >
        <apex:pageBlockSection >
            <apex:inputField value="{!Task.WhatId}" style="white-space: nowrap;" styleClass="lookupInput;" />
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:form>
</apex:page>

It is getting displayed as below, without any space between two input boxes. But if the same field is seen in a standard salesforce page, there is space between those two input boxes. How to make the two input boxes of the below lookup field to have some space in between them similar to that of standard salesforce page lookup field.

No space issue between two input boxes of lookup field in VF

Thanks.


 
Best Answer chosen by JayaJaya
ManojjenaManojjena
Hi JayaJaya,

Please check the below code it will solve your problem .
<apex:page standardcontroller="Task">
    <apex:form >
        <apex:pageblock mode="edit" >
            <apex:pageblocksection >
                <apex:inputfield value="{!Task.WhatId}" />
            </apex:pageblocksection>
        </apex:pageblock>
    </apex:form>
</apex:page>

**Please select it as best answer if it solve your problem to help others.

All Answers

ManojjenaManojjena
Hi JayaJaya,

Please check the below code it will solve your problem .
<apex:page standardcontroller="Task">
    <apex:form >
        <apex:pageblock mode="edit" >
            <apex:pageblocksection >
                <apex:inputfield value="{!Task.WhatId}" />
            </apex:pageblocksection>
        </apex:pageblock>
    </apex:form>
</apex:page>

**Please select it as best answer if it solve your problem to help others.
This was selected as the best answer
JayaJayaJayaJaya
Thanks a lot Manoj, it solved the problem.