0

I have a custom field which is called Date__c (It's a Date field type) and I want to display it on a custom VF page.

<label>Date:</label>
  <apex:inputText value="{!workLog.Date__c}" styleClass="date form-control"/>

The problem is that I get a text box and not a calendar as I expect to see.date

How can I make it show the calendar?

I searched all over this forum but with no success, I only found this post which suggested to use something like this:

<apex:input value="{!workLog.Date__c}" type="date" />

but it produced this error:

Error: <apex:input> does not support fields on a Salesforce object. 
Use <apex:inputField> for expression '{!workLog.Date__c}'

Please assist

2

Change your code to

<apex:inputfield value="{!workLog.Date__c}" styleClass="date form-control"/>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.