Hide Current Date Link For Date Type Inputfield

The standard apex:inputfield component for a date field generates current date link next to the input field. Sometimes we need to hide this link.

Here is an example to hide the current date link for date type inputfield. Here I’ve added the visibility:hidden in dateFormat CSS class to hide the link.

<style type="text/css">
    .dateFormat{
    visibility:hidden;
    }
</style>

Visualforce Page:

<apex:page standardController="Opportunity"> 
    <style type="text/css">
        .dateFormat{
        visibility:hidden;
        }
    </style>
    <apex:form>  
        <apex:pageBlock title="Opportunity">  
            <apex:pageBlockSection title="Opportunity Information">  
                <apex:inputField value="{!Opportunity.Name}"/> 
                <apex:inputField value="{!Opportunity.Amount}"/>  
                <apex:inputField value="{!Opportunity.Type}"/> 
                <apex:inputField value="{!Opportunity.LeadSource}"/> 
                <apex:inputField value="{!Opportunity.CloseDate}"/>  
            </apex:pageBlockSection>  
        </apex:pageBlock>  
    </apex:form>  
</apex:page>  

Output:

1 Star2 Stars3 Stars4 Stars5 Stars (4 votes, average: 5.00 out of 5)
Loading...

About Biswajeet

Biswajeet is my Name, Success is my Aim and Challenge is my Game. Risk & Riding is my Passion and Hard Work is my Occupation. Love is my Friend, Perfection is my Habit and Smartness is my Style. Smiling is my Hobby, Politeness is my Policy and Confidence is my Power.