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
ckumckum 

Date Picker Calendar is not opening on first time load

Hi,

 

In my page. I have a standard date field given below:

<td>

<apex:inputField id="txtWarrantyDate" value="{!Quo.Renewal_Date__c}" onchange="javascript: SavingItems()" />

<script>

 

objRenewalDate.push(document.getElementById('{!$Component.txtWarrantyDate}'));

</script>

</td>

 

Once I load the page it donot open the calendar, and when I refresh it, the Calendar opens normally.

 

For the first time when I click on the text box of Date it is showing javascript error:

Error: this.div is null
Source File: https://c.cs3.visual.force.com/jslibrary/1257456714000/main.js

 

Unable to solve this issue. Kindly revert back ASAP.

 

Thanks,

ckum

bob_buzzardbob_buzzard

Try removing the javascript... at the start of the onchange:

 

 

onchange="SavingItems()"

 

 Onchange expects javascript code, so that shouldn't be necessary.

 

If that doesn't help, can you post your entire page, so that we can see all your javascript.

 

ckumckum

Sorry, this did not worked. It is still giving the same issue. The given code is the only relative code for this. Kindly tell some other way around to get through this.

 

Or else I will send my full code.

 

Thanks,

ckum 

bob_buzzardbob_buzzard

What I'd try next is to selectively comment out JavaScript/VF components to try to narrow down the cause of the problem.  For example, commenting out the JavaScript immediately after the input field to see if that's having an effect.

 

 

Try reducing your page to the bare minimum that allows the Date inputField to be displayed and see if the calendar renders okay on first load.  If it does, start adding back in the other components/javascript etc until it breaks.   Sometimes this is the only way to get to the bottom of things.

ckumckum

Hi Bob,

 

I tried this also, but it is not causing any change in it. :(

 

Any other way around.

 

Thanks,

ckum

bob_buzzardbob_buzzard
Only other thing I can think of is to capture the source and run it through an HTML validator - I think W3C have one that you can use online.  That may give a clue to the problem.