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
saimadhusaimadhu 

calendar look up

In my vf page i have a date filed

date: input text 

i have to place calendar lookup for this date field

how to do this.

please give me sample code.

Best Answer chosen by Admin (Salesforce Developers) 
PremanathPremanath

Hi this may helpful to you

 

<script>
function DynamicDatePicker(d_id)
{
DatePicker.pickDate(true,d_id.id,false);
}
window.onload=function() {
// prevent autopup of the date inputfield by the default focus behavoir
document.getElementById('focusDistraction').focus();
}
</script>

<b>Date </b><apex:inputText value="{!sdate}" id="time" onfocus="DynamicDatePicker(this);" size="20" disabled="false" style="width:80px;"/>

All Answers

PremanathPremanath

Hi this may helpful to you

 

<script>
function DynamicDatePicker(d_id)
{
DatePicker.pickDate(true,d_id.id,false);
}
window.onload=function() {
// prevent autopup of the date inputfield by the default focus behavoir
document.getElementById('focusDistraction').focus();
}
</script>

<b>Date </b><apex:inputText value="{!sdate}" id="time" onfocus="DynamicDatePicker(this);" size="20" disabled="false" style="width:80px;"/>

This was selected as the best answer
saimadhusaimadhu

yes, it helped me. thaks a lot.

saimadhusaimadhu

oh,sure