473,794 Members | 2,748 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(CCGetPa ram("Button1", Empty)) Then
PressedButton = "Button1"
End If
End If
session("txtWID ")=request("txt WID")
Redirect = "Weapon_related .asp?" & CCGetQueryStrin g("QueryString" ,
Array("ccsForm" , "Button1"))
If Validate() Then
If PressedButton = "Button1" Then
If NOT Button1.OnClick () Then
Redirect = "Weapon_related .asp?" &
CCGetQueryStrin g("QueryString" , Array("ccsForm" , "Button1"))
End If
End If
Else
session("txtWID ")=request("txt WID")
Redirect = "Weapon_related .asp?" &
CCGetQueryStrin g("QueryString" , Array("ccsForm" , "Button1"))
End If
End Sub

'End NewRecord1 Operation Method

Tnx in advance
Marco
Jul 19 '05 #1
1 1826
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='OpenWi ndow();' 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="JavaS cript">
<!--
function OpenWindow()
{
url = "your window url here "
var hWnd = window.open(url ,"a__name","her e 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.*********@ch ello.nl> wrote in message
news:a7******** *************** **@posting.goog le.com...
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(CCGetPa ram("Button1", Empty)) Then
PressedButton = "Button1"
End If
End If
session("txtWID ")=request("txt WID")
Redirect = "Weapon_related .asp?" & CCGetQueryStrin g("QueryString" ,
Array("ccsForm" , "Button1"))
If Validate() Then
If PressedButton = "Button1" Then
If NOT Button1.OnClick () Then
Redirect = "Weapon_related .asp?" &
CCGetQueryStrin g("QueryString" , Array("ccsForm" , "Button1"))
End If
End If
Else
session("txtWID ")=request("txt WID")
Redirect = "Weapon_related .asp?" &
CCGetQueryStrin g("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
4758
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 like this: %@ Language=VBScript %> <!--#include file="includes/openconnection.asp"-->
6
16287
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 = myCookie.substring(9); if (OpenOnly == "True") { document.ViewOptions.Open.checked = true;
2
2636
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 code connected with a cmdNew_Record button in the second form. This command shows several hidden buttons and instructions, as well as opening a blank record. I have tried a line "RunCommand acRunCmd..." to try to get the second method to run, but...
26
4498
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 System.EnterpriseServices;
4
5541
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 runs. I tried to define another Button with an EventHandler associated, and from this (after doing my code) fire 'btnSearch.click()'. But I can't make it work. I tried private void Button1_Click(object sender, System.EventArgs e RestartAll()...
2
3060
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" target="_blank">click here</a> can't be: <a href="somepage.aspx?value1=xyz" pagewidth="500px or %" page height="500px or %" target="_blank">click here</a> then what about in the code behind using: response.redirect("somepage.aspx?value1=xyz",...
3
3364
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 btNew.Click Server.Transfer("New.aspx?") ' this moves to a
4
3518
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 click a button on a pop-up window the javascript for that button click does a 'button.form.submit'. On the Server side there is a Button click event for this button, but for some reason it no longer fires. It worked fine before and everything...
1
1675
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
9671
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9518
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10212
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10161
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10000
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9035
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4112
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.