Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > What button do I need to open a new form

Reply
Thread Tools

What button do I need to open a new form

 
 
Krechting
Guest
Posts: n/a
 
      01-03-2004
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
 
Reply With Quote
 
 
 
 
only_me
Guest
Posts: n/a
 
      01-03-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
2 button form + which button was pressed Bill_W_Stephens@yahoo.com Javascript 1 04-04-2006 04:25 AM
How to fake a button click for HTTP form button harleyman1974@gmail.com ASP .Net 2 11-21-2005 06:59 PM
Open new form and pass variables with button click Microsoft ASP .Net 1 04-28-2005 11:04 PM
default submit button in multi-button form Andrew Crowe HTML 2 02-06-2004 10:44 PM
JavaScript Access to Button in form tags (webcontrol or html button) Wes Weems ASP .Net 1 07-20-2003 05:27 AM



Advertisments