Loading

Visualforce apex:input Date Picker Browser Compatibility

Julkaisupäivä: Jun 18, 2026
Kuvaus

When using the <apex:input> Visualforce (VF) tag with the type='date' attribute, the date picker UI may not appear in certain browsers. This occurs because <apex:input> supports HTML5 input types, but not all browsers implement the HTML5 date input type with a visual calendar date picker. Unsupported browsers display a plain text input field instead of a date picker. This is a known browser compatibility limitation and is not a Salesforce bug.

Affected Browsers

The <apex:input type='date'> element relies on the browser's native implementation of the HTML5 date input type. Browsers that do not support this HTML5 input type will render a plain text field instead of a calendar date picker. For a current list of browser compatibility with the HTML5 date input type, see the MDN Web Docs link in Additional Resources below.



 

Ratkaisu

To display a date picker reliably across all Salesforce-supported browsers, replace <apex:input type='date'> with <apex:inputField>.
The <apex:inputField> tag binds directly to a Salesforce standard or custom object field and renders the appropriate native Salesforce date picker, which is consistent across all supported browsers.
Example:
Replace: <apex:input type="date" value="{!myDateVariable}" />
With: <apex:inputField value="{!myRecord.DateField__c}" />

Important Limitation

<apex:inputField> requires binding to a Salesforce standard or custom object field. It cannot be used with a standalone Apex controller property that is not bound to a Salesforce object field.
If your page uses a controller property (not bound to an object field), consider the following alternatives:

  • Use a JavaScript date picker library (for example, jQuery UI Datepicker or a Lightning Web Component with a date input)
  • Restructure the controller to use a Salesforce object field binding
Knowledge-artikkelin numero

000386422

 
Ladataan
Salesforce Help | Article