Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 175
  • Last Modified:

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>
                   
0
Kevin Robinson
Asked:
Kevin Robinson
1 Solution
 
Ivo StoykovCommented:
Hello VolunteerDevelopmentAgency,

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

HTH

I
0
 
Kevin RobinsonAuthor Commented:
still rendered?
0
 
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Kevin RobinsonAuthor 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 RobinsonAuthor 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 RobinsonAuthor 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
 
CetusMODCommented:
PAQed with points refunded (500)

CetusMOD
Community Support Moderator
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now