You need to sign in to do that
Don't have an account?
Unable to view Calender for Date Field Due to Window.Onload In PE
Hi Folks!!
I am developing a Visualforce Page in PE where I used a date field(Visited_Date__c) of a custom object(CCIR__c)
I am able to access the calendar of that date field initially, but after adding the window.onload in the javascript I
could not.
Please find my code snippet below:
//------------------------------------------------------------------------------------
<apex:page standardcontroller="CCIR__c">
<apex:form id="myform">
<script type="text/javascript">
window.onload = DefaultSettings;
function DefaultSettings()
{
//Default Settings
}
</script>
<apex:inputfield id="id" value="{!CCIR__c.Visited_Date__c}"/>
</apex:form>
</apex:page>
//----------------------------------------------------------------------------------
Kindly suggest me with a solution for this ASAP.
Thanks in advance!!
Regards,
Sanjana
Don't use OnLoad in a script like that. It is a surefire way to screw up the default loading behavior of Salesforce. This is due to the fact that onload is not a "collection" event system, such as it is in C#; assigning your own value here overrides the default load mechanism. Instead, use the attachEvent/addEventListener method: