Open Window - Invalid arguement? 
Author Message
 Open Window - Invalid arguement?

I need a little help! Getting "An exception of the type 'Invalid arguement.'
was not handled."
I'm calling an open window function from another jscript opened window.  It
appears to be working ok in another part of the app(legacy) with different
parameters.
***************************************************************
The code that chokes is:
function openNewWindow2(sURL,sName,theWidth,theHeight)
{
var strDems = "width="+theWidth+",height="+theHeight
var newWindow=window.open(sURL,sName,strDems);
Quote:
}

***************************************************************
Values in the window.open call above are as follows:
?sURL
"PatientInfo.asp?MedRecNumber=60-87-21"
?sName
"Archive Info"
?strDems
"width=650,height=450"
****************************************************************
I'm adding an href via ASP VBScript code as follows:
rw "<a href='javascript:openNewWindow2(""PatientInfo.asp?MedRecNumber=" &
Server.URLEncode(fldMRNumber.Value) & """,""Archive
Info"",650,450);'>"
rw "Archive</a></TD>" & vbcrlf
****************************************************************
I figured it was the querystring not being in acceptable form so I ran it
through the
Server.URLEncode function but that didn't seem to help.  Any ideas??

Thanks!
Harry



Sun, 29 Aug 2004 22:44:57 GMT  
 Open Window - Invalid arguement?
Change the sName argument to "_blank" or "_self"

'Name' is the name of a window to use.

Paul.


Quote:
> I need a little help! Getting "An exception of the type 'Invalid
arguement.'
> was not handled."
> I'm calling an open window function from another jscript opened window.
It
> appears to be working ok in another part of the app(legacy) with different
> parameters.
> ***************************************************************
> The code that chokes is:
> function openNewWindow2(sURL,sName,theWidth,theHeight)
> {
> var strDems = "width="+theWidth+",height="+theHeight
> var newWindow=window.open(sURL,sName,strDems);
> }
> ***************************************************************
> Values in the window.open call above are as follows:
> ?sURL
> "PatientInfo.asp?MedRecNumber=60-87-21"
> ?sName
> "Archive Info"
> ?strDems
> "width=650,height=450"
> ****************************************************************
> I'm adding an href via ASP vbscript code as follows:
> rw "<a href='javascript:openNewWindow2(""PatientInfo.asp?MedRecNumber=" &
> Server.URLEncode(fldMRNumber.Value) & """,""Archive
> Info"",650,450);'>"
> rw "Archive</a></TD>" & vbcrlf
> ****************************************************************
> I figured it was the querystring not being in acceptable form so I ran it
> through the
> Server.URLEncode function but that didn't seem to help.  Any ideas??

> Thanks!
> Harry



Sun, 29 Aug 2004 23:48:47 GMT  
 Open Window - Invalid arguement?
Think it was the space between Archive and Info it didn't like.  Thanks that
works great!!!!

 now another problem....

I'm opening a window from a form, then another window from that window.  I'm
using:

function doOK(sPatNumber) {
 if (window.opener != null) {
  if (window.opener.document.all("txtPatientNumber") != null) {
   window.opener.document.all("txtPatientNumber").value = sPatNumber
  }
 }
 window.close();

Quote:
}

in the original new window to pass info back to the form that opened the
first window.

Now, i'd like to pass this info to the original form from the second window
spawned.....can i pass info back through two windows??
Embedded window.opener??

I'm very new to jscript.  Any help much appreciated!!

Thanks much
Harry


Quote:
> Change the sName argument to "_blank" or "_self"

> 'Name' is the name of a window to use.

> Paul.



> > I need a little help! Getting "An exception of the type 'Invalid
> arguement.'
> > was not handled."
> > I'm calling an open window function from another jscript opened window.
> It
> > appears to be working ok in another part of the app(legacy) with
different
> > parameters.
> > ***************************************************************
> > The code that chokes is:
> > function openNewWindow2(sURL,sName,theWidth,theHeight)
> > {
> > var strDems = "width="+theWidth+",height="+theHeight
> > var newWindow=window.open(sURL,sName,strDems);
> > }
> > ***************************************************************
> > Values in the window.open call above are as follows:
> > ?sURL
> > "PatientInfo.asp?MedRecNumber=60-87-21"
> > ?sName
> > "Archive Info"
> > ?strDems
> > "width=650,height=450"
> > ****************************************************************
> > I'm adding an href via ASP vbscript code as follows:
> > rw "<a href='javascript:openNewWindow2(""PatientInfo.asp?MedRecNumber="
&
> > Server.URLEncode(fldMRNumber.Value) & """,""Archive
> > Info"",650,450);'>"
> > rw "Archive</a></TD>" & vbcrlf
> > ****************************************************************
> > I figured it was the querystring not being in acceptable form so I ran
it
> > through the
> > Server.URLEncode function but that didn't seem to help.  Any ideas??

> > Thanks!
> > Harry



Mon, 30 Aug 2004 00:11:30 GMT  
 Open Window - Invalid arguement?
AFAIK you shouldn't have any problem.

Try window.opener.opener.document.all

Bear in mind, this is theory!

P.


Quote:
> Think it was the space between Archive and Info it didn't like.  Thanks
that
> works great!!!!

>  now another problem....

> I'm opening a window from a form, then another window from that window.
I'm
> using:

> function doOK(sPatNumber) {
>  if (window.opener != null) {
>   if (window.opener.document.all("txtPatientNumber") != null) {
>    window.opener.document.all("txtPatientNumber").value = sPatNumber
>   }
>  }
>  window.close();
> }

> in the original new window to pass info back to the form that opened the
> first window.

> Now, i'd like to pass this info to the original form from the second
window
> spawned.....can i pass info back through two windows??
> Embedded window.opener??

> I'm very new to jscript.  Any help much appreciated!!

> Thanks much
> Harry



> > Change the sName argument to "_blank" or "_self"

> > 'Name' is the name of a window to use.

> > Paul.



> > > I need a little help! Getting "An exception of the type 'Invalid
> > arguement.'
> > > was not handled."
> > > I'm calling an open window function from another jscript opened
window.
> > It
> > > appears to be working ok in another part of the app(legacy) with
> different
> > > parameters.
> > > ***************************************************************
> > > The code that chokes is:
> > > function openNewWindow2(sURL,sName,theWidth,theHeight)
> > > {
> > > var strDems = "width="+theWidth+",height="+theHeight
> > > var newWindow=window.open(sURL,sName,strDems);
> > > }
> > > ***************************************************************
> > > Values in the window.open call above are as follows:
> > > ?sURL
> > > "PatientInfo.asp?MedRecNumber=60-87-21"
> > > ?sName
> > > "Archive Info"
> > > ?strDems
> > > "width=650,height=450"
> > > ****************************************************************
> > > I'm adding an href via ASP vbscript code as follows:
> > > rw "<a

href='javascript:openNewWindow2(""PatientInfo.asp?MedRecNumber="

- Show quoted text -

Quote:
> &
> > > Server.URLEncode(fldMRNumber.Value) & """,""Archive
> > > Info"",650,450);'>"
> > > rw "Archive</a></TD>" & vbcrlf
> > > ****************************************************************
> > > I figured it was the querystring not being in acceptable form so I ran
> it
> > > through the
> > > Server.URLEncode function but that didn't seem to help.  Any ideas??

> > > Thanks!
> > > Harry



Mon, 30 Aug 2004 00:24:42 GMT  
 Open Window - Invalid arguement?
Harry,

On first glance you seem to have 2 sets of double quotes together, certainly
the openNewWindow2 function looks ok, but the <a href> seems to need some
escaping of the "... so it is "/"  or "' and not just "".

That would be my first guess without taking the time to replicate your
error..

Ric.


Quote:
> I need a little help! Getting "An exception of the type 'Invalid
arguement.'
> was not handled."
> I'm calling an open window function from another jscript opened window.
It
> appears to be working ok in another part of the app(legacy) with different
> parameters.
> ***************************************************************
> The code that chokes is:
> function openNewWindow2(sURL,sName,theWidth,theHeight)
> {
> var strDems = "width="+theWidth+",height="+theHeight
> var newWindow=window.open(sURL,sName,strDems);
> }
> ***************************************************************
> Values in the window.open call above are as follows:
> ?sURL
> "PatientInfo.asp?MedRecNumber=60-87-21"
> ?sName
> "Archive Info"
> ?strDems
> "width=650,height=450"
> ****************************************************************
> I'm adding an href via ASP vbscript code as follows:
> rw "<a href='javascript:openNewWindow2(""PatientInfo.asp?MedRecNumber=" &
> Server.URLEncode(fldMRNumber.Value) & """,""Archive
> Info"",650,450);'>"
> rw "Archive</a></TD>" & vbcrlf
> ****************************************************************
> I figured it was the querystring not being in acceptable form so I ran it
> through the
> Server.URLEncode function but that didn't seem to help.  Any ideas??

> Thanks!
> Harry



Mon, 30 Aug 2004 00:29:40 GMT  
 Open Window - Invalid arguement?
this will also work.  you will have to pass the form and
input you will want to write back to in the opener.

function doOK(OpenerForm, OpenerInput, sPatNumber) {
 if (window.opener != null) {
  if (window.opener.document.all("txtPatientNumber") !=
null) {
   window.opener.document[OpenerForm][OpenerInput].value =
sPatNumber
  }
 }
 window.close();

Quote:
}



Mon, 30 Aug 2004 00:57:46 GMT  
 Open Window - Invalid arguement?
Thanks much!! I've got the code in place but i can't seem to get by the
syntax for this in the calling hyperlink i write with ASP vbscript - this
throws an "expected end of statement" error
Added the three parameters...
how can i clean this up?
rw "<TD class=ItemClass onclick='doOK("PrintManager","txtPatientNumber","""
& fldPatientNumber.Value & """)'
style='cursor:hand;text-decoration:underline;'>"

TIA
Harry


Quote:
> this will also work.  you will have to pass the form and
> input you will want to write back to in the opener.

> function doOK(OpenerForm, OpenerInput, sPatNumber) {
>  if (window.opener != null) {
>   if (window.opener.document.all("txtPatientNumber") !=
> null) {
>    window.opener.document[OpenerForm][OpenerInput].value =
> sPatNumber
>   }
>  }
>  window.close();
> }



Mon, 30 Aug 2004 03:50:33 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Invalid argument opening a new browser window

2. window.open only opens 1 window

3. how do I open the current window again without opening a new window

4. Problem with window opened with window.open method in IE

5. Closing a window that was opened with the window.open method

6. Using Window.Open to open HTML page

7. opening a window in a window

8. Window should open in new window

9. why parent window reloads on window.open() ?

10. window.open(): Cannot re-use existing window on IE5 on Mac

11. window.open and window.close

12. window.location.href && window.open

 

 
Powered by phpBB® Forum Software