Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

About window.dialogArguments

Status
Not open for further replies.
Nov 8, 2005
25
CA
Hi there
If I'm in a page and am trying to call a modal window dialog, I'll pass in some parameters. Now I do in javascript the following:

var objParam = new Object();
objParam.argParam1 = "A";
objParam.argParam2 = "B";

And in the modal window I process it like this in vbscript:

dim a, b
a = window.dialogArguments.argParam1
b = window.dialogArguments.argParam2

(Don't ask me why they're in the script languages that they are - the code existed long before I joined the company)

The above works bascially fine, except I have to add an optional parameter 3. So in the modal window I'll process it like argParam1 and argParam2, that is,

dim a, b,c
a = window.dialogArguments.argParam1
b = window.dialogArguments.argParam2
c = window.dialogArguments.argParam3

However since like I said it is optional, the calling page may or oay not pass in argParam3.

If I don't pass objParam.argParam3, in the modal window I'll get an error:

Object doesn't support this property or method:
window.dialogArguments.argParam3

So my question is, is there something I can check inside the modal window for the existence of argparam3 without prompting this error message? I know it's doable in javascript but it looks like I need to do my checking using vbscript, just want to know how I can handle that.

This is optional and only 5 out of the 100 places will require this argParam3. I don't want to have to go through the remaining 95 places to add in this argParam3 just so that it exists when the modal window is called.

Any help is appreciated.

Thanks
Calgarychinese
 
[tt]dim a, b,c
a = window.dialogArguments.argParam1
b = window.dialogArguments.argParam2
on error resume next
c = window.dialogArguments.argParam3
if err.number<>0 then
c="some default value"
err.clear
end if
on error goto 0
[/tt]
 
Hi tsuji

Yeah that would actually work! So many people (in other forums) have kept giving me javascript but what I need is vbscript (even if my task doesn't require vbscript I have been dying to find out if there is an equivalent).

If you can give me a quick answer though, you've disabled error handling because you issue "resume next". But does "goto 0" enable error handling again? If so, then I think that would be 100% what I need.

Thanks
CC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top