javascript Error

I have the following code that opens up a pop up calendar which USED to work now I am getting this error.


error
======
Window.opener.form1.txtdate is null or not an object


code
=======
 <asp:HyperLink ID="Hyperlink1" runat="server" NavigateUrl="javascript:calendar_window=window.open('../calendar.aspx?formname=form1.txtDate','calendar_window',  'width=210,height=188,status=no'); calendar_window.moveTo(400,300);  calendar_window.focus()" ImageUrl="../images/icon_cal.gif">HyperLink</asp:HyperLink>
                   
LVL 3
Kevin RobinsonPrivate VB.NET ContractorAsked:
Who is Participating?
 
CetusMODConnect With a Mentor Commented:
PAQed with points refunded (500)

CetusMOD
Community Support Moderator
0
 
Ivo StoykovCommented:
Hello VolunteerDevelopmentAgency,

probably it is not stil rendered... just a shot

HTH

I
0
 
Kevin RobinsonPrivate VB.NET ContractorAuthor Commented:
still rendered?
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
xberryCommented:
>>> which USED to work now I am getting this error

so you must have changed something, what was it that you did
do to your code ?

Also I guess, you're still using same browser to view your result ?
0
 
Kevin RobinsonPrivate VB.NET ContractorAuthor Commented:
Yeah I copied the code from one page to another.  But ALL the code was copied.  The names of the controls it is referencing are the same name and same case.
0
 
xberryCommented:
>>> NavigateUrl="javascript:calendar_window=window.open

Also, I'd like to point your attention to this reference:

http://developer.mozilla.org/en/docs/DOM:window.open#Never_use_this_form_of_code_for_links:.3Ca_href.3D.22javascript:window.open.28....29.22_....3E
0
 
Kevin RobinsonPrivate VB.NET ContractorAuthor Commented:
Not really worrried about different browsers.  The code is used in an admin section used by about 10 people.  if it only works in IE thats ok.
0
 
xberryCommented:
Just noticed this one:

In your error message:  

Window.opener.form1.txtdate is null or not an object   //     form1.txtdate       ('d' in date written small)

In your code:

window.open('../calendar.aspx?formname=form1.txtDate'   //   form1.txtDate   ('D' in Date writen big)

so there is a difference !   I'd sort that out first and see if it helps.
0
 
Kevin RobinsonPrivate VB.NET ContractorAuthor Commented:
I just typed that in manually. The txtDate is right.

I think i know what the problem is.  I copied the code from a normal page to one that uses a ASPX MasterPage.  
The code is basically sending javascript to a page,  but because the page is using a master page the java script is not getting in to the HEAD.

0
 
ZvonkoSystems architectCommented:
that is mostly the problem, that scripting does not go into the head ;-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.