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
nimbusprojectnimbusproject 

How to make a visualforce inputbox pop out a calender?

I was wondering how to make an inputbox that will pop out a calendar to set a Date field value.

 

Could you please include a simple example possibly.

paul-lmipaul-lmi
i think if you use inputField, it does it for you, if the result datatype is a native field and that field type is datetime.  as far as custom controllers, not sure if that works (doubt it).
bob_buzzardbob_buzzard

That's correct - an inputfield will render the appropriate input components for a field type.  Unfortunately the popup calendar is somewhat limited - mine, for example, only goes back to 2007, which is not particularly useful for capturing date of birth type information.

 

I ended up using a third party javascript calendar tied to an inputtext component.  That way you get full control over the behaviour, date format etc.  You'll have to write some code to go that route though.