Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Client Side Invoice submitting data to a new window advice needed 2

Status
Not open for further replies.

Medwyn

Technical User
Apr 15, 2001
9
NZ
I am a student and have come across a problem.
I have created an online client side Invoice and have been asked that when the invoice is to be submitted that a new window is to open and display the appropriate data.
I am unsure of how to do this but any help/guidance etc will be great!


Thanks

Medwyn
 
<script language=Javascript>
function openNewWindow() {
popupWin = window.open('invoice.htm',
'open_window',
'scrollbars,resizable,width=640,height=480,left=0,top=0')
}
</script>


Example:

<a href=&quot;javascript:eek:penNewWindow();&quot;>Invoice</a>
br
Gerard
(-:

Better a known bug then a new release.
 
Thanks Foxbox, but the problem is I am doing it in VBscript.
Which is why I posted here.
How would you do that in VBScript?



Medwyn
 
opening a new browser-window is client-side. when you use VBScript for that, you'll have problems with non-IE users... br
Gerard
(-:

Better a known bug then a new release.


| Do it!
|
V
 
I know but it is what I am required to do, so I am doing it.
I have already brought up the point of using VBScript, but it is what they want.
 
If you want to open a link in a new window, all you have to do is reference the &quot;target&quot; for opening the link.

For this all you need is plain HTML. See below:

<a href=&quot;./invoice.htm&quot; target=&quot;_blank&quot;>DevGuru.com</a>

Now, if you want to submit a form, and have the returned page display in a new window, i'd have to say that you're going to have problems with that - it would be too easy for someone to resubmit, because you left the input screen open. It would be better to leave the results in the original window, than to have to write error-checking procedures just because you left the submitting screen open.
 
That is very helpful thank you, but I was wishing to open the new window in which it displays the invoice as an html when you click on a button.

I am very well aware that this is not the best way to do that it is open to ALOT of errors but it is what has been asked to do and I have to do this part first and then explain why and then state changes etc I would make to have it work better.

So how do I link a page opening to a button?

thanks

Medwyn
 
Medwyn,

Use the open method of the window object:

Code:
Dim objNewWindow
Dim sURL

sURL = &quot;[URL unfurl="true"]http://urltomypage...&quot;[/URL]

Set objNewWindow = window.open
(sURL,&quot;MyNewWindow&quot;,&quot;Location=Yes,Status=No,Scrollbars=No,To
olbar=No,MenuBar=No,Top=50,Left=30,Width=740,Height=450,Resi
zable=Yes&quot;)

objNewWindow.focus
 
Thanks

I wish to transfer some values from the 'old page' to this 'new page' that is opened up. What is the best way to do that?

Medwyn

 
Hi

I have created a page on which data is entered and then it is validated and
suuch by clicking a button.
When that is done it opens a new blank html page and the data then put there
to be read off.

How do I do that?

I have a sub which validates the data and then opens a blank html, upon this
html I wish to put the data values that have been entered.


Thanks


Medwyn

 
request.form( fieldname_from_initial_form )


????? br
Gerard
(-:

Better a known bug then a new release.


| Do it!
|
V
 
Hi

I got the window.open to work, but I can't get it to close
Can anybody help?
Here's my code

If flag = &quot;0&quot; then
set newwindow = window.open(&quot;Sample.htm&quot;,&quot;subWind&quot;,&quot;height=200,width=400,
status=yes,toolbar=no,menubar=no,location=no&quot;)
newwindow.focus()
else
window.close
end if
***********************
Insted of window.close is there a way to do newwindow.close

Thank you
 
>Insted of window.close is there a way to do newwindow.close<

There is probably an easier way, but I just call the following:
Code:
Sub open_self_closer(window_name)
   window.open &quot;self_closer.htm&quot;, window_name
   window.focus      
End Sub
The html for self_closer.htm is:
Code:
<html>
<head>
<title></title>
</head>
<body onload=&quot;window.close()&quot;>
</body>
</html>
 
thank you,
But window.open &quot;self_closer.htm&quot;, window_name
will open another window. And close it.

How can I keep the new window open? while the parent window is still processing. Once the processing is over the new window should close.

Any ideas how this can be done?


Thank you.
 
If flag = &quot;0&quot; then
set newwindow = window.open(&quot;Sample.htm&quot;,&quot;subWind&quot;,&quot;height=200,width=400,
status=yes,toolbar=no,menubar=no,location=no&quot;)
newwindow.focus()
else
newwindow.close
end if
 
Thank you I tried that......
the problem arises when the IF condition is false.
If the condition is false &quot;newwindow&quot; is not present.
So it will give an error on &quot;newwindow.close&quot;
saying not present.
Is there way thru which we can verify whether &quot;newwindow&quot; is initalised then,
if it is then close it.

Thankyou I appreciate your efforts.



 
Hopefully, the 3rd time is the charm.
Code:
Dim newwindow             'Global variable/object
set newwindow = nothing   'Global assignment

Sub 
   If flag = &quot;0&quot; then 
      set newwindow = window.open(&quot;Sample.htm&quot;,&quot;subWind&quot;,&quot;height=200,width=400,
status=yes,toolbar=no,menubar=no,location=no&quot;)
      newwindow.focus()
   Else
      If newwindow Is Nothing Then
         ' do nothing
      Else
         newwindow.close          
         set newwindow = nothing
      End If
   End if 
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top