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

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" sidebar="false">
<apex:form id="myform">
<script src="/soap/ajax/18.0/connection.js"></script>
<script type="text/javascript">
window.onload = FillDefaultValues;
sforce.connection.sessionId = "{!$Api.Session_ID}";


function FillDefaultValues() {
accountid = null;
productid = null;
recordid = null;
document.getElementById('myDoctorsDropdown').focus();

}

</script>
<apex:pageBlock title="CCIR Form" id="pageblockid">
<div id="output"></div>
<table>
<tr>
<th>Doctor Code</th>
<th>Doctor Name</th>
<th>Speciality</th>
<th>Catageory</th>
<th>Brand</th>
<th>Product</th>
<th>Activity</th>
<th>Visited With</th>
<th>Prescribed</th>
<th>Promoted</th>
<th>Sample</th>
<th>Feedback</th>
</tr>
<tr>
<td>
<select id="myDoctorsDropdown" onchange="getddoctordata(this)">
<option value="none">--None--</option>
</select>
</td>
<td>
<input id="idDoctorname" disabled="true" style="width:150px;text-align:right;"/>
</td>
<td>
<input id="idspeciality" disabled="true" style="width:150px;text-align:right;"/>
</td>
<td>
<select id="myCategeoriesDropdown" onchange="GetBrandsWithDuplicates()">
<option value="none">--None--</option>
</select>
</td>
<td>
<select id="myBrandsDropdown" onchange="FillProducts()">
<option value="none">--None--</option>
</select>
</td>
<td>
<select id="myProductsDropdown" onchange="getProductId(this)">
<option value="none">--None--</option>
</select>
</td>
<td>
<apex:inputfield id="activityid" value="{!CCIR__c.Activity__c}" />
</td>
<td>
<b><apex:inputfield id="vistedatedid" value="{!CCIR__c.Visited_Date__c}" /></b>
</td>
<td>
<apex:inputfield id="prescribedid" value="{!CCIR__c.Prescribed__c}" onkeypress="return isNumberKey(event)"/>
</td>
<td>
<apex:inputfield id="promotedid" value="{!CCIR__c.Promoted__c}" onkeypress="return isNumberKey(event)"/>
</td>
<td>
<apex:inputfield id="sampleid" value="{!CCIR__c.Sample__c}" onkeypress="return isNumberKey(event)"/>
</td>
<td width="50%" align="left">
<apex:inputfield id="feedbackid" value="{!CCIR__c.Feedback__c}" />
</td>
<td>
<input type="button" value="Save" onclick="SaveCCIRValues()" id="btnSave" />
</td>
<td>
<input type="button" value="Cancel" id="btnCancel" onclick="Test()"/>
</td>
</tr>
</table>

</apex:pageBlock>
</apex:form>
</apex:page>

//----------------------------------------------------------------------------------


Kindly suggest me with a solution for this ASAP.


Thanks in advance!!


Regards,

Sanjana