You need to sign in to do that
Don't have an account?
raj123
remove default date value from date input field on visual force page
i am getting a default todays date when the page loads in the inputfield for date, how can i remove this
<apex:outputLabel value="To:" />
<apex:inputField value="{!EndRecDate.Message_Posted__c}" id="dateorg3" onchange="populateHiddenFields()"/>
Hi,
You can remove the value from your input field by using the JavaScript
For Example
<script>
Docuement.getElementbyId(‘compoenentid’).value=’’;
</script>
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
i am not able to remov, the default value , actually i am doing the following
apex:pageblocksectionItem id="pgsecItm2">
<apex:outputLabel value="To:" /><apex:inputField value="{!EndRange.Date}" id="dateorg2" onchange="populateHiddenFields()"/>
</apex:pageblocksectionItem>
<script>
function populateHiddenFields()
{
document.getElementById('{!$Component.pg:frm:pgBlk:dateHdn}').value=document.getElementById('{!$Component.pg:frm:pgBlk:pgsec:pgsecIt:dateorg}').value; if i do.value='' ; the value is not getting populated.
}
<script>
<apex:inputHidden id="dateHdn" value="{!strStartShipDate}"/>
can you please help me with this
Do you have a default value set in the definition of the date field on the object it is associated with?
If so, remove that.
@Starz
I dont have any default value on the field set.
its getting its value from somewhere as the date does not just magically appear by putting the field there...