473,404 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

What button do I need to open a new form

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
Jul 19 '05 #1
1 1814
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

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Samantha Smit | last post by:
Hi, I am trying to create a simple asp page that has one command button that updates a database. The URL of the page is like this: http://MyServer.com/Update.asp?UserName=Tom My asp code is...
6
by: Ken Loomis | last post by:
Hello: On a web page I check the value of a cookie and set one of two radio buttons accordingly. function setRadioForm() { var myCookie = document.cookie; var OpenOnly =...
2
by: Jade Tippett | last post by:
I am trying to design a button in one form that opens another form and executed a button method within that form. I want to button to open a form based on a different table, then execute the...
26
by: Lasse Edsvik | last post by:
Hello I'm trying to build a simple COM+ app in vs.net using C# and i cant register it in component manager..... what more is needed than this: using System; using...
4
by: Carlo Marchesoni | last post by:
I have a button that opens a new Window (some kind of search-window), which is fired using JavaScript (btnSearch.Attributes=".....";) Now I need to run some code behind code BEFORE this JavaScript...
2
by: Chris | last post by:
I know this is a dead horse I'm beating but why is it so impossible to ask for functionality in the HTML tag to open a window/page more controllable? why is: <a href="somepage.aspx?value1=xyz"...
3
by: | last post by:
Hi I am using vb.net code behind. In my code I have a button click event on my main web form. Private Sub btNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles...
4
by: John Boy | last post by:
Hi, Can anyone help. This is really doing my nut in. 3 years ASP exp. and now doing .DOT which is a step in the wrong direction. Basically I am left with the code of a guy who has left. When I...
1
by: regelcom | last post by:
My son is trying to create an about form button for a form he has already created. Any help would be great. Thanks
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.