Solved

Form to New window

Posted on 2001-06-13
10
274 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 informatio…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

707 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