Solved

Form to New window

Posted on 2001-06-13
10
273 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

726 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