views:

42

answers:

3
<form action="mail.php" method="post" target="_blank">
    <textarea name="mess" cols="50" rows="5"></textarea>
    <input name="send" type="submit" value="Send">
</form>

After pressing the button "submit", brouwser will open a new window with some text like "OK, your messagw sent to our mailbox".

Can I make this "new" window NOT fullsize of browser, but 400x300 resolution.

(also i have "mail.php" file with the next code:

<?php
if (isset ($mess))
{
$mess = substr($mess,0,10000);
if (empty($mess))
{
echo "<center><b>Message written<p>";
echo "<a href=back-form.html>Go back and make all steps correctly</a>";
exit;
}
}
else 
{
$mess = "Unspecified";
}
$i = "не указано";
if ( $mess == $i)
{
echo "Error! The script does not have to pass parameters!";
exit;
}
$to = "[email protected]";  /*адрес*/
$subject = "Message to your website";
$message = "Message:$mess";
mail ($to,$subject,$message) or print "Cant send your letter!";
echo "<center><b>Thanks for ypur attention.";
exit;
?> 

)

+2  A: 

To open a new window with javascript check out window.open() method here http://www.w3schools.com/jsref/met_win_open.asp.

qw3n
A: 

You can set the target of your form to a new window set you opened with javascript before:

myForm.onsubmit = function(){
   var w = window.open('about:blank','Popup_Window','width:200,height:200');
   myForm.target = 'Popup_Window';
}
eskimoblood
A: 

Try using this onload function in the new window:

<body onload="resizeTo(400,300)">

400 is the width, 300 is the height.

Note: resizeTo() isn't supported by all major browsers. More info at w3cschools.

Josh
It resize ALL BROWSER with ALL windows, i need to resize only the new opened window.
TRAVA
@TRAVA: It should resize *only* the current window, and does so for me in Firefox. What browser are you using?
Josh