Seems to be some confusion here between server side code and client side
code
Button1.OnClick() can only run on the client and so cant be in teh same
code block as " Redirect = "Weapon ..."
You need to get it clear the separation betwen html/javascript ( and
VBscript) which can be executed by the browser itself and teh vbscript which
runs on the server - it does take a while to get your head round but it is
vital to understanding the intereaction between client ansd server
In response to your specific question
In the client HTML code you would define a buton ( not a submit button)
<input type=button onClick='OpenWindow();' blah blah
later on the page you would have some javascript like this - you will need
to further reseach the paramter list supported by the javascript window.open
command
<SCRIPT Language="JavaScript">
<!--
function OpenWindow()
{
url = "your window url here "
var hWnd = window.open(url,"a__name","here would be a list of parameters
which define window operation");
hWnd.focus();
if (!hWnd.opener)
hWnd.opener = self;
}
// End -->
</script>
There are many variations on this theme, but hopefully this should get you
started
"Krechting" <m.*********@chello.nl> wrote in message
news:a7*************************@posting.google.co m...
Hi All,
I need a button on my form that opens a new window.
I put in a submit button but it always returns to my first page.
And then my first page is empty.
What button do I need to go to another page (weapon_related)?
This is what I use at the moment:
'NewRecord1 Operation Method @3-0C905987
Sub Operation()
If NOT ( Visible AND FormSubmitted ) Then Exit Sub
If FormSubmitted Then
PressedButton = "Button1"
If Not IsEmpty(CCGetParam("Button1", Empty)) Then
PressedButton = "Button1"
End If
End If
session("txtWID")=request("txtWID")
Redirect = "Weapon_related.asp?" & CCGetQueryString("QueryString",
Array("ccsForm", "Button1"))
If Validate() Then
If PressedButton = "Button1" Then
If NOT Button1.OnClick() Then
Redirect = "Weapon_related.asp?" &
CCGetQueryString("QueryString", Array("ccsForm", "Button1"))
End If
End If
Else
session("txtWID")=request("txtWID")
Redirect = "Weapon_related.asp?" &
CCGetQueryString("QueryString", Array("ccsForm", "Button1"))
End If
End Sub
'End NewRecord1 Operation Method
Tnx in advance
Marco