I'm using <apex:input>
tag to display date. It's working fine in Chrome but it's not working in Mozilla.
<apex:input type="date" id="dateid">
The apex:input
component is translated into an HTML input
element in the generated HTML. The input type of "date" is not supported in Firefox at this time, whereas it is supported in Chrome.
Try :
<apex:inputField value="{!MyDate}" label="My date :" type="date"/>
See http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_inputField.htm
value="{!MyDate}"
call the getMyDate()
controller method. That's what you want to know ?
I also faced this problem with the and I used the and got the same error which you are getting.
As a workaround what I did is I created an instance of the standard controller record and used its date field as a container to hold the
<apex:inputField value="{InstanceOfObject.AnyDateField}">
This way you will be able to hold the input from the page and use it from the Instance in a controller.
Inside Controller:
ObjectApi InstanceOfObject {get;set;}
Here the Object's Instance will just act as a holder for date inputted from page.
Thank You.
You can use a shim/polyfill that will detect whether browser has this feature and will render date picker using Javascript. I had success using this package: nodep-date-input-polyfill.
Just include nodep-date-input-polyfill.dist.js
in your Visualforce page and rest will be taken care.
Note that it will look slightly different than native date pickers.
Edit: Here's one more alternative when you need a datepicker but you have no sObject:
<span class="dateInput dateOnlyInput">
<apex:inputText id="inputFieldId" size="12" value="{!DateStringProperty}" style="width:72px;text-align:center;" onclick="DatePicker.pickDate(false, this, false);" onfocus="DatePicker.pickDate(false, this, false);"/>
</span>
Further outlined here.