Click to See Complete Forum and Search --> : window.showModalDialog Question Options


cmptrnerd9
May 25th, 2007, 02:21 PM
I am using window.showModalDialog in VBScript and when I close the
modal dialog, I want the parent page to redirect to another URL.

I know you can do it in javascript with window.opener.location.href,
but that doesnt work in vbscript for me.


Can someone help?


Thanks,
Michael

PeejAvery
May 25th, 2007, 03:25 PM
Drop the .href and you will have it for VBScript.

cmptrnerd9
May 30th, 2007, 10:11 AM
Drop the .href and you will have it for VBScript.

Thanks!!! I have another issue with it though, and maybe you can help. Here is the situation

Page 1 opens up page 2 in a popup. Page 2 does some processing and redirects to page 3. After getting to page 3, when you click a button on it, I want to run the window.opener.location.

It errors out there, saying object required window.opener

PeejAvery
May 30th, 2007, 12:14 PM
So long as you have defined the window "opener" properly, it is just opener.location. If that does not work, please show how you defined the window "opener" using [code] tags.

[code]
Your code goes here.
[/code]

cmptrnerd9
May 30th, 2007, 01:43 PM
<script language=vbscript> window.opener.location="http://www.url.com/"</script>

PeejAvery
May 30th, 2007, 05:44 PM
Well, first off, you must define script tag type. The language attribute is depreciated.

<script type="text/vbscript">...</script>
Second, that isn't where you define the window opened, that is where you are attempting to control it. Where do you define the window? In other words, where is the code that gives the title opener to an actual window?

cmptrnerd9
May 31st, 2007, 08:14 AM
Well, first off, you must define script tag type. The language attribute is depreciated.

<script type="text/vbscript">...</script>
Second, that isn't where you define the window opened, that is where you are attempting to control it. Where do you define the window? In other words, where is the code that gives the title opener to an actual window?

Sorry, here it is


<script language=VBScript>
dim retVal
retVal = window.showModalDialog ("../../../custserv/WebPes/Misc/Launch.aspx?url=HomeCopyType.aspx",window,"dialogHeight: 270px; dialogWidth: 390px; dialogTop: px; dialogLeft: px; edge: Raised; center: Yes; help: No; resizable: No; status: No;")
</script>

PeejAvery
May 31st, 2007, 08:20 AM
Well, retval is short for return value. Usually that is best assigned to a function that returns something. In this case, I would assign a different name to the window.

But, as it, you would say...
retVal.window.location