Link to home
Start Free TrialLog in
Avatar of scorpio1975
scorpio1975

asked on

Form to New window

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.
ASKER CERTIFIED SOLUTION
Avatar of DMN
DMN

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of scorpio1975
scorpio1975

ASKER

But how can i submit the form data to a.asp?
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
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?
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>
DMN,
Your right, your code works fine, However, so does mine.
pretty cool..

see ya
killertech
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
And you can set any window parameters in window.open call, like scrollable, status, tollbar etc.

        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