What button do I need to open a new form

K

Krechting

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
 
O

only_me

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top