Solved

Form to New window

Posted on 2001-06-13
10
269 Views
Last Modified: 2009-12-16
How can i set the size of a target window?
i have this;

<form action="a.asp" method="post" target="_new">


.........
.....
<input type ="submit">
<form>

But i cant seem to set the size of the new window.How can i maximise the new window?
Thanks for any help.
0
Comment
Question by:scorpio1975
10 Comments
 
LVL 4

Accepted Solution

by:
DMN earned 25 total points
ID: 6187024
You can create target window JUST BEFORE submitting form, using JavaScript like shown below:

<html>
<body>
<script>
function openTarget()
{
  w=window.open("about:blank","mytarget","fullscreen");
}
</script>
<form target="mytarget" onsubmit="openTarget(); return true;">
<input type="submit" name="submit">
</form>

</body>
</html>
0
 

Author Comment

by:scorpio1975
ID: 6187220
But how can i submit the form data to a.asp?
0
 

Expert Comment

by:killertech
ID: 6187592
I think this may work.

<html>
<body>
<script>
function openTarget()
{
 w=window.open("a.asp","mytarget","fullscreen");
}
</script>
<form target="mytarget" onsubmit="openTarget(); return true;">
<input type="submit" name="submit">
</form>

</body>
</html>

killerrech
0
 
LVL 3

Expert Comment

by:yas022100
ID: 6187594
You can use as part of URL Parameter something like..

<Form Name=frmInput Id=frmInput Action=a.asp Method=Post onSubmit=CheckIt()>
<Input Type=Text Name=txtInput1 Id=txtInput1>
</Form>

<Script Language=Javascript>
   function CheckIt()
   {
      frmInput.Action = 'a.asp?TextValue1=' + escape(frmInput.txtInput1.value)
   }
</Script>

By Including as part of Parameter, inside of a.asp you will say

<%

   sValue = Request.querystring( "TextValue1" )

%>

Instead Of

<%
   sValue = Request.Form( "TextValue1" )
%>

Does that make sense?
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 4

Expert Comment

by:DMN
ID: 6187951
NOOOO!!!!!!!!!!!

To submit form to a.asp you should:

<html>
<body>
<script>
function openTarget()
{
 w=window.open("about:blank","mytarget","fullscreen");
}
</script>
<form action="a.asp" method="post" target="mytarget" onsubmit="openTarget(); return true;">
<input type="submit" name="submit">
</form>

</body>
</html>
0
 

Expert Comment

by:killertech
ID: 6188002
DMN,
Your right, your code works fine, However, so does mine.
pretty cool..

see ya
killertech
0
 

Expert Comment

by:killertech
ID: 6188013
You may also want to put a window focus() line in so that a.asp will come into focus if by chance it is already open.
Like so:

function openTarget()
{
w=window.open("about:blank","mytarget","fullscreen");
w.focus();
}
</script>

killertech
0
 
LVL 4

Expert Comment

by:DMN
ID: 6188877
And you can set any window parameters in window.open call, like scrollable, status, tollbar etc.
0
 
LVL 14

Expert Comment

by:puranik_p
ID: 8647070

        No comment has been added lately, so it's time to clean up this TA.
         I will leave a recommendation in the Cleanup topic area that this question is:

->    Accept DMN's comment as answer

         Please leave any comments here within the next seven days.
         
         PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
         
         puranik_p
         EE Cleanup Volunteer  

0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
post data with a link 8 49
Random function on ASP page not working 6 47
Replacing smart quotes from word 7 61
API not working 33 48
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 have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now