Click here to Skip to main content
13,004,446 members (75,401 online)
Rate this:
Please Sign up or sign in to vote.
See more:
i tried to add a calender by a popup window and everything is working fine but its not picking up date and shows a error in javascript console
Uncaught TypeError: Cannot read property 'document' of null PopupCalendar.aspx:10
SetDate PopupCalendar.aspx:10
(anonymous function)
the javascript function is
<script type="text/javascript" language="javascript">
       function SetDate(dateValue) {
           // retrieve from the querystring the value of the Ctl param,
           // that is the name of the input control on the parent form
           // that the user want to set with the clicked date
           ctl =;
           // set the value of that control with the passed date
           thisForm = window.opener.document.forms[0].elements[ctl].value = dateValue;
           // close this popup

and i wm copying it from Customizing the ASP.NET Calendar Control[^]
any suggestion....
Posted 8-May-13 22:27pm
Tadit Dash 9-May-13 5:38am
Can you please zip your project and provide the uploaded link here ?
You can use or DropBox or any other uploading site.
Vishal Pand3y 9-May-13 5:41am
Vishal Pand3y 9-May-13 5:48am
there is a page addtender and PopupCalendar.aspx and control CalenderControl.ascx for that
Tadit Dash 9-May-13 5:57am
It is big project... And it is not building it my end.
If I will try to clear those errors, then it will take time.

Instead do one thing. You said you have referred that article (the link you have provided in question), so go to that article and ask a question to him/her by putting a comment towards the bottom of article.

He might help you better.

And one more thing... You can debig line by line of the javaScript code and see where exactly it is throwing the error, may be you can get a hint, what is wrong.

Vishal Pand3y 9-May-13 6:01am
i have tried to debug it with breakpoints it i it doesn't stop there....
Tadit Dash 9-May-13 6:03am
Did u put debugger; inside javaScript function ?
Vishal Pand3y 9-May-13 6:04am
no breakpoints
Tadit Dash 9-May-13 6:20am
No, put the code
inside the function you want to debug. Then from FireBug in Firefox, you can easily debug and see the values line by line...

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

check whether the code was working or not. by using alert();
Vishal Pand3y 9-May-13 5:23am
the code is working
in JavaScript console error comes Uncaught TypeError: Cannot read property 'document' of null PopupCalendar.aspx:16
SetDate PopupCalendar.aspx:16
(anonymous function)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170627.1 | Last Updated 9 May 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100