You need to sign in to do that
Don't have an account?
vikramkk
Datepicker in Visualforce page
Regarding this post
I tried option 2 with <apex:inputtext> inside <apex:column> in pageblocktable. But I didn't calendar popup. Do I need to make any change to make it work?
Thanks
Vikram
Hi,
Try the below code snippet as reference
=====vf======
<apex:page controller="DatePickerDEmo" id="myPage">
<apex:form id="myForm">
<script>
function DynamicDatePicker(d_id)
{
DatePicker.pickDate(false,d_id.id,false);
}
</script>
<apex:pageBlock title="My Content" id="pb1">
<apex:pageBlockTable value="{!Con}" var="item">
<apex:column >
Date <apex:inputText value="{!d_date_str}" id="t" onfocus="DynamicDatePicker(this);" onchange="checkDateFormatt(this.id);" size="20" disabled="false" style="width:150px;"/>
</apex:column>
<apex:column value="{!item.name}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
=========Apex Controller======
public class DatePickerDEmo {
public String d_date_str { get; set; }
public List<Contact> Con { get; set; }
public DatePickerDEmo()
{
Con =new List<Contact>();
con=[select name from Contact Limit 10];
}
}
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.