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
sfdc007sfdc007 

Date picker field in VF Page

Hi,

I need help on the following requirement in vf page

i have a Visualforce page where i have a free text box where i have to enter date using date picker for some reason <apex:Input type ="date"> is not working

let me know how to achieve this requirement

Thanks in Advance
Ashish_Sharma_DEVSFDCAshish_Sharma_DEVSFDC
Hi sfdc007,

Please use <apex:inputField value={! Your Date Field} /> ,Datepicker will pop up automatically then if it is date field.

Let us know if it helps.
bob_buzzardbob_buzzard
Specifying the HTML5 type on an apex:input tag tells the browser to use its own date capture widget.  This sounds like the browser doesn't provide that support.  Another way to achieve this is to use a "carrier" sobject, an in memory Task in your controller for example, and bind the task date to an apex:inputField tag - that way the standard Visualforce date picker will be used.
Mudasir WaniMudasir Wani
Hello,

Here is a similar question.

https://developer.salesforce.com/forums?id=906F000000097bvIAA


Donot forget to select best answer to make our efforts visible in the developer forum.
Please mark this as solution by selecting it as best answer if this solves your problem, So that if anyone has this issue this post can help
Amoolya DontyAmoolya Donty
Hi,

Please use the below code. This requires jQuery and datePicker field generates if you do not have field in the object.

<apex:page >

<link rel="stylesheet" href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css"/>
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css"/>
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>

Date: <input type="text" id="datepicker"/>

</apex:page>