Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET Javascript
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 = window.location.search.substr(1).substring(4);
            // set the value of that control with the passed date
            thisForm = window.opener.document.forms[0].elements[ctl].value = dateValue;
            // close this popup
            self.close();
        }
and i wm copying it from Customizing the ASP.NET Calendar Control[^]
any suggestion....
Posted 8-May-13 23:27pm
Comments
Tadit Dash at 9-May-13 5:38am
   
Can you please zip your project and provide the uploaded link here ?
You can use Ge.tt or DropBox or any other uploading site.
Vishal Pand3y at 9-May-13 5:41am
   
http://ge.tt/4esUzAg/v/0
Vishal Pand3y at 9-May-13 5:48am
   
there is a page addtender and PopupCalendar.aspx and control CalenderControl.ascx for that
Tadit Dash at 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.
 
Thanks,
Tadit
Vishal Pand3y at 9-May-13 6:01am
   
i have tried to debug it with breakpoints it i it doesn't stop there....
Tadit Dash at 9-May-13 6:03am
   
Did u put debugger; inside javaScript function ?
Vishal Pand3y at 9-May-13 6:04am
   
no breakpoints
Tadit Dash at 9-May-13 6:20am
   
No, put the code
debugger;
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
good
Please Sign up or sign in to vote.

Solution 1

check whether the code was working or not. by using alert();
  Permalink  
Comments
Vishal Pand3y at 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
0 Maciej Los 310
1 OriginalGriff 295
2 Afzaal Ahmad Zeeshan 224
3 Sergey Alexandrovich Kryukov 195
4 BillWoodruff 160
0 OriginalGriff 6,499
1 Sergey Alexandrovich Kryukov 6,048
2 DamithSL 5,193
3 Manas Bhardwaj 4,657
4 Maciej Los 4,120


Advertise | Privacy | Mobile
Web03 | 2.8.1411022.1 | Last Updated 9 May 2013
Copyright © CodeProject, 1999-2014
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