Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Client Side VBScript New Window w/ custom attributes

Posted on 2001-07-19
7
Medium Priority
?
354 Views
Last Modified: 2008-03-03
I'm having difficulty working out how to open a new window when a user submits a form and customize that window's attributes, such as no toolbar, no menubar, specific size etc.  I expect there's a way to setup the window properties using some basic client side VBScript, but the only way I can seem to make that work is to actually Open the new window with the properties.  I don't want to open the window until the user submits the form.  

Here's some details:
I have a few ways to open the window when the form is submitted.  I can declare a target attribute in the form declaration itself;
<form name="AppSelection" Action="chosenapp.asp" Method="POST" TARGET="NewWin">

I can also write a simple client side validation routine;
Function AppSelection_OnSubmit
Document.AppSelection.Target="NewWin"
End Function

Both of these work.  What I need to do is figure out how to customize the NewWin attributes.  I can't use a hyperlink, I must use the form submission.  What I'd like to end up with is something along the lines of:

Sub Whatever
NewWin.toolbar = no
NewWin.menubar = no
NewWin.scrollbars = yes
NewWin.status = yes
NewWin.Height = 600
NewWin.Width = 800
End Sub

And then open the window using either of the two options above.  

Any ideas?
0
Comment
Question by:Sinjun
  • 4
  • 3
7 Comments
 
LVL 20

Expert Comment

by:jitganguly
ID: 6299395
Well how about submitting the page to a file and from there you use a window.open

<form name="AppSelection" Action="abc.asp" Method="POST">
..
...
</form>


abc.asp

<script language="VBScript">
sub helpopen()
     window.open "xyz.asp","newwindows","width=350,height=540,resizable=yes,toolbar=no,status=on,location=no,menubar=no,left=430,top=1 scrollbars=yes"
end sub
</script>

You may want to pass teh values to the new window
0
 
LVL 2

Author Comment

by:Sinjun
ID: 6299963
I'm pretty much already doing that, but the problem is getting the form values passed to the target page while, at the same time, have that page open in the new, custom window.

0
 
LVL 20

Expert Comment

by:jitganguly
ID: 6299979
Whats the problem if you pass it by querystring ? Is it too long ?
You can do something like

<script language="VBScript">
    window.open "xyz.asp?var1=<%=var1%>&var2=<%=var2%>","newwindows","width=350,height=540,resizable=yes,toolbar=no,status=on,location=no,menubar=no,left=430,top=1
scrollbars=yes"
</script>

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 2

Author Comment

by:Sinjun
ID: 6299997
QueryString won't work for a few reasons, one of which is I need to pass a password entered from the form, and I can't use cookies either.  :)
0
 
LVL 20

Accepted Solution

by:
jitganguly earned 900 total points
ID: 6300022
OK. Very unusual problem you have.
How about do a javascript form post ? Get the values in action page , create a form with hidden values and post the form with javascript form post.
Not exactly sure
0
 
LVL 2

Author Comment

by:Sinjun
ID: 6302980
Thanks a lot.  It took me a little code wrangling to totally get what I needed, but your answer pointed me right at the solution.  Very much appreciated!
0
 
LVL 20

Expert Comment

by:jitganguly
ID: 6303022
Hmm. Glad I could help you. But why 'B' ?
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question