473,549 Members | 2,360 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

pop up window opens and closes onClick, but link won't open

6 New Member
Hi Everyone,

I have a popup window that opens when clicking a link. The pop up window asks a question and supplies two buttons, Yes and No. The buttons are images and when the user clicks the button, they will either be linked to another page via the Yes button or they will stay on the same page if they click the No button.

The popup window is supposed to close once the Yes or No button is clicked, and it does, however, it ignores the link that is attached to the Yes button.

I am using Dreamweaver to create the code for the popup window:
Expand|Select|Wrap|Line Numbers
  1. <a href="javascript:void(0)" class="link2" onClick="MM_openBrWindow('pop_EBM.htm','','width=345,height=160')">Enrollment Billing Manual - Independent Practitioners</a>
Then I have this code attached to the Yes button:
Expand|Select|Wrap|Line Numbers
  1.  <td height="40"><div align="right"><a href="ebm/Practitioners_Manual.pdf" target="_blank" onclick="window.close()"><img src="../images/btn_yes.gif" alt="Yes" width="50" height="20" border="0"></a></div></td>
Any suggestions on how I can get this to work?
Thanks alot for any help you can offer!
Amy
Aug 16 '07 #1
13 3213
Nahum Silva
4 New Member
Hi emy I think that the problem is that you are trying to open the page in your pop up and not in the pages the show the pop up, I think you can achieve what are you looking if you try somenthing like parent.document and manipulate whatever you want... also you can display not a popup itself instead you can show a div layer for the same purpose... this way you can avoid all popup blocker and all tha stuff.. look into google for submodal popups can help you... see you around...
Aug 16 '07 #2
pbmods
5,821 Recognized Expert Expert
Heya, Amy. Welcome to TSDN!

Please use CODE tags when posting source code. See the REPLY GUIDELINES on the right side of the page next time you post.
Aug 16 '07 #3
amymcdo3
6 New Member
Thanks for the reply, but I forgot to mention that it works in IE, but not Firefox or Netscape. Any suggestions as to what is causing it to not go to the link in Firefox and Netscape? I do have target_blank, so I am not trying to open the linked to page in the same window as the popup....

thanks!!
Aug 16 '07 #4
pbmods
5,821 Recognized Expert Expert
Heya, Amy.

Modern browsers will execute JavaScript or else follow the href in an anchor tag, but not both.

Instead, try doing this:
Expand|Select|Wrap|Line Numbers
  1. <img src="../images/btn_yes.gif" alt="Yes" width="50" height="20" border="0" style="cursor:pointer;" onclick="window.open('ebm/Practitioners_Manual.pdf'); window.close();" />
  2.  
Aug 16 '07 #5
amymcdo3
6 New Member
Hey Pbmods,

You are AWESOME! I have been trying to resolve this for 2 days and could not figure out how to make this work in Firefox. It works perfectly now!

THANKS!!!!
Amy
Aug 16 '07 #6
pbmods
5,821 Recognized Expert Expert
Heya, Amy.

Glad to hear you got it working! Good luck with your project, and if you ever need anything, post back anytime :)
Aug 16 '07 #7
amymcdo3
6 New Member
Hi again,

I just checked this in Netscape 8 and Netscape 9, and it opens the link fine, but then the pop up will not close. It stays open and turns white.

Any suggestions?

Thanks!!!
Amy
Aug 17 '07 #8
pbmods
5,821 Recognized Expert Expert
Heya, Amy.

Maybe try self.close()... . Did you originally open this window using JavaScript, by any chance? Netscape will only allow you to close() what you open().
Aug 17 '07 #9
amymcdo3
6 New Member
Hi,

I used the code that you gave me in box #5. Do I need to change it self.close now. I am worried that changing it, will make it not work in Firefox......

Thanks!!
Aug 17 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

5
9696
by: Carol Lyn | last post by:
Could use your assistance with this. I have a window that opens via onclick and it is a small window with info about a site. If the user is interested in visiting that site, there is a link to click that opens the site in a new and larger window via onclick. My question is, can I have the smaller window automatically close when the user...
3
5166
by: Steve | last post by:
Hi, I have a nice little script that works well displaying images on my website. It's a script where if you clik a thumbnail image a pop up window opens that contains a larger version of the same image. What I would like to create is a link that can be clicked on to close the window that contains the larger image. This would make it easier...
4
2193
by: Dan Cruz | last post by:
Below are two files: Main.asp and Help.asp. I've stripped it down to the 'barest-of bones' so that anyone willing to help can duplicate the problem on their own systems. ***Main.asp*** looks like so: <HTML> <HEAD> <TITLE>Main</TITLE>
31
2810
by: Benno Bös | last post by:
If I use the following construct in the frame "main" for a link to an extern site: <A HREF="http://www.any.xy" TARGET="extern"> the Browser is creating the window "extern", loading the page www.any.xy an setting the focus to "extern". But when I go return to "main" without closing "extern", a click to an other link (e.g. www.2nd_any.xy)...
5
2275
by: Sean Berry | last post by:
I have a news video that I am sending out for a client. There are embedded links to flash movies in the email. I want the popup to be a set size (400 x 400). I am currently using the following code, but the popup window is not 400 x 400, it is whatever the browser size was last time it was opened. How can I set the absolute size from...
19
31021
by: Darren | last post by:
I have a page that opens a popup window and within the window, some databse info is submitted and the window closes. It then refreshes the original window using window.opener.location.reload(). The problem is that after the reload, it brings you right to the top of the page. When I click 'refresh" on the original page, it brings me back to...
3
2244
by: JohnEGee | last post by:
Hello, all, and TIA for any help you can offer. I've searched the Internet for answers and have finally come here. I've created a page (several, actually) with a link that opens a pop-up window. It's a pop-up window in the sense that it's smaller than the man page and is intended to be viewed and then closed. The problem is that if I...
1
3408
by: Samy | last post by:
Hi There, I have a child window opened from aspx page using window.open. On the child window, I have a button(New category) which opens a grandchild. I also have a cancel button on the child window which when clicked should close the child and the granchild windows. Can anybody suggest me how this can be accomplished. I am using image...
18
3309
by: len.hartley | last post by:
Hi, I am trying to pop-up a window when the user clicks on an image. The problem is that when the user clicks on the image and the window pops up OK, but the window underneath also proceeds to the image. The desired behavior is that when the pop-up is invoked, I want the underlying window to stay put. I don't have this problem when I...
0
7542
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7467
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7982
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7500
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7827
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
3514
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3494
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1961
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1079
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.