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
AnithaThanAnithaThan 

Unable to view Calender for Date Field Due to Window.Onload In PE (Javascript)

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

ClaiborneClaiborne

Normally, to prevent the calendar from displaying when the page initially loads, I use this code on the visualforce page:

 

    <script>
        function setFocusOnLoad() {}
    </script>