Click here to Skip to main content
15,880,469 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
JavaScript
<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
Comments
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 9-May-13 5:41am    
http://ge.tt/4esUzAg/v/0
Vishal Pand3y 9-May-13 5:48am    
there is a page addtender and PopupCalendar.aspx and control CalenderControl.ascx for that
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 9-May-13 6:01am    
i have tried to debug it with breakpoints it i it doesn't stop there....

1 solution

check whether the code was working or not. by using alert();
 
Share this answer
 
Comments
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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900