+ Start a Discussion
nlsnydernlsnyder 

Can you show date field in apex page as inputField without the date link?

I have a apex page with a dataTable that contains a date field as a apex:inputField.

Is there anyway to show the date textbox (that popups the calendar) without the date link?

Best Answer chosen by Admin (Salesforce Developers) 
nlsnydernlsnyder

It looks like it will work when I figure out how to format the date.

All Answers

Navatar_DbSupNavatar_DbSup

Hi,

Try the below code snippet as reference.
=======vf=========
<apex:page controller="DatePickerDEmo2">
<apex:form id="myForm">
<script>
function DynamicDatePicker(d_id)
{

DatePicker.pickDate(false,d_id.id,false);
}
</script>
<table>
<tr><td>DatePicker From JavaScript</td><td><apex:inputText value="{!d_date_str}" id="t" onfocus="DynamicDatePicker(this);" onchange="checkDateFormatt(this.id);" size="20" disabled="false" style="width:150px;"/></td></tr>
<tr><td>DatePicker From Input Field</td><td><apex:inputField value="{!c.Birthdate}"/></td></tr>
</table>
</apex:form>
</apex:page>

========Apex Controller=========

public class DatePickerDEmo2 {

public String d_date_str{get;set;}
public Contact c{get;set;}
public DatePickerDEmo2()
{
c=new Contact();
}
}


Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.

nlsnydernlsnyder

It looks like it will work when I figure out how to format the date.

This was selected as the best answer