Click to See Complete Forum and Search --> : opening new browser window in vbscript


kbrown2974
02-12-2004, 07:29 AM
I am looking to open a new browser window in vbscript. I want to be able to open multiple windows at the same time. I currently have it as response.redirect..dont wanna do this though.

PeOfEo
02-12-2004, 04:02 PM
Originally posted by kbrown2974
I am looking to open a new browser window in vbscript. I want to be able to open multiple windows at the same time. I currently have it as response.redirect..dont wanna do this though. to do this the vbscript would have to be run client side, but unfortunatly vbscript is not supported well at all. Your best bet would be to user some java script to open new windows, and have a backup plan for the 13% of the users who do not have java script enabled.

kbrown2974
02-16-2004, 06:26 AM
i can try using some javascript for it. window.open the easiest way to do it?

I dont have to worry about java not being enabled. This is gonna only be used in the office I am at..we enabled java on all the machines.

buntine
02-16-2004, 06:46 AM
Yes, window.open() is the best method.

Are you ok with the code? Its pretty easy stuff. Post if you run into trouble.

kbrown2974
02-16-2004, 06:54 AM
I'll give it a try..if I run into trouble, I'll post my progress.

Thanks
:)

kbrown2974
02-16-2004, 07:05 AM
Ok..I got it to open a new window with the page that I want. The only thing is that I want it to be able to open multiple windows if the user chooses more than 1 selection. There are some options that have to go to new windows, some dont. The script is below that is giving me the prob. If I select more than 1, it goes to the first one and that is it.

<SCRIPT TYPE="Text/JavaScript">
<!--
function Winmove()
{
var kitval;
var kitarray = new Array(30);
var tempval;
var maxcount;
kitval = document.MyForm.kit.value;
kitarray = kitval.split(",");

if (document.MyForm.kit.length == 0)
{
maxcount = 0
}
else
{
maxcount = kitarray.length
}

if (maxcount == 1)
{
maxcount = 0
}

for (var i=0; i <= maxcount;i++)
{
if (maxcount == 0)
{
tempval = kitval
}
else
{
tempval = kitarray(i)
}

if (document.MyForm.kit.value == "SC") { document.cookie = "speccare=Y" }
if (document.MyForm.kit.value == "CB") { document.cookie = "classic=Y" }
if (document.MyForm.kit.value == "PC") { document.cookie = "prefcare=Y" }
if (document.MyForm.kit.value == "S65")
{
document.cookie = "sec65=Y"
win65 = window.open("sec65kit.asp","65win")
}
if (document.MyForm.kit.value == "MB")
{
document.cookie = "medgap=Y"
winmed = window.open("medkit.asp","medwin")
}
if (document.MyForm.kit.value == "SB")
{
document.cookie = "secblue=Y"
winblue = window.open("secblukit.asp","bluewin")
}
if (document.MyForm.kit.value == "KM") { document.cookie = "keymu=Y" }
if (document.MyForm.kit.value == "CC") { document.cookie = "compcare=Y" }
if (document.MyForm.kit.value == "DB") { document.cookie = "dirblue=Y" }
if (document.MyForm.kit.value == "PB") { document.cookie = "prefblue=Y" }
if (document.MyForm.kit.value == "FB")
{
document.cookie = "freedom=Y"
winfree = window.open("freedomkit.asp","freewin")
}
if (document.MyForm.kit.value == "HC") { document.cookie = "HCTC=Y" }
}
return true;
}
//-->
</SCRIPT>

Suggestions?
Thanks

Ribeyed
02-16-2004, 08:44 AM
Hi,
this is not an asp question please post in the correct forum.
Also you have started 2 different posts for the same question.

buntine
02-16-2004, 09:24 AM
The best way to do it is to create a for loop. This way you will avoid all those If statements and your program will flow better.

Ribeyed - Its odd how so many people post javascript questions in this forum... Nobody seems to understand that ASP and Javascript are a horrible pair.

PeOfEo
02-16-2004, 10:42 AM
Originally posted by [SWR]Ribeyed
Hi,
this is not an asp question please post in the correct forum.
Also you have started 2 different posts for the same question. should I move this to the java script forum... becasue that is what this question seems to be turning in to :rolleyes:

kbrown2974
02-16-2004, 11:07 AM
OK