Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Multiple pop up window?

Author  Topic 

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2005-03-15 : 12:49:14
Is it possible to have multiple pop up windows. At the moment when I open a new pop up window, it replaces the current one.

Here's what I have for code:

<script language="javascript">
function windowOpen(sURL,sWinName){
var params = 'height=410,width=420,directories=no,location=no,menubar=no,status=no,titlebar=no,toolbar=no,scrollbars=yes,resizeable=no';
window.open(sURL,sWinName,params);
}
</script>




<input id="btnNewQuote" type="button" onclick="windowOpen('http://intranet/Quotes/CreateQuote.aspx?user=<%#strAuthUsr%>','CreateQuote');" Class="Normal" value=" New Quote " runat="server">

I wonder if it be possible to use like a target=_blank for this. Any suggestions?

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2005-03-15 : 21:00:56
the "sWinName" part of your code "names" the window. When you send another call to that window, it replaces what was there before.

Give them unique names.


Damian
Go to Top of Page

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2005-03-16 : 15:42:41
Thanks for the response. I did change the sWinName to be different for both pop window, but it still replacing it the current pop window.

First popup window:
<script language="javascript">
function windowOpen(sURL,sWinName){
var params = 'height=410,width=420,directories=no,location=no,menubar=no,status=no,titlebar=no,toolbar=no,scrollbars=yes,resizeable=no';
window.open(sURL,sWinName,params);
}
</script>

Second pop up window:

<script language="javascript">
function windowOpen(sURL,sWinPopUp){
var params = 'height=410,width=420,directories=no,location=no,menubar=no,status=no,titlebar=no,toolbar=no,scrollbars=yes,resizeable=no';
window.open(sURL,sWinPopUP,params);
}
</script>
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2005-03-16 : 15:47:17
i'm not sure what you are showing us ... you have two functions named the same, one per pop-up window? You don't need this (and in fact don't WANT this!)

You should have just 1 function and each time you call it you pass in a new window name, as Damian mentioned. It is not the function definition that is causing problems, it is how you are calling it.

- Jeff
Go to Top of Page

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2005-03-16 : 18:05:21
So you mean by passing the new window name, do you mean what i have below?


<input id="btnNewQuote" type="button" onclick="windowOpen('http://intranet/Quotes/CreateQuote.aspx?user=<%#strAuthUsr%>','CreateQuote');" Class="Normal" value=" New Quote " runat="server">

For example 'CreateQuote' is the name for that pop up and then probably a different one for the second popup? I'm not clear on what you mean pass the window name.
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2005-03-16 : 18:20:56
yes, the second pop-up should have a different window name.

- Jeff
Go to Top of Page
   

- Advertisement -