Connecting Tech Pros Worldwide Help | Site Map

Javascript and Forms

Sylvain Perreault
Guest
 
Posts: n/a
#1: Jul 20 '05
Hi,

here's my code:

<form action="mailing.php" method="post" target="mailing">
<div align="center">E-mail
<input type="Text" name="email">
<input name="action" type="hidden" id="action" value="add">
<input name="" type="submit"
onClick="javascript:window.open('','mailing','tool bar=0, location=0,
directories=0, status=0, scrollbars=1, resizable=0, copyhistory=0,
menuBar=0, width=300, height=250')" value="Submit">
</div>
</form>


When I click on submit, everything is fine, a popup opens and the result of
the form is printed in it.
If I press ENTER, there's a new window opening but it's not the window in
OnClick

So, How can I have the same result in both case???

Thanks

Sylvain Perreault


Evertjan.
Guest
 
Posts: n/a
#2: Jul 20 '05

re: Javascript and Forms


Sylvain Perreault wrote on 15 feb 2004 in comp.lang.javascript:
[color=blue]
> onClick="javascript:window.open('','mailing','tool bar=0, location=0,
> directories=0, status=0, scrollbars=1, resizable=0, copyhistory=0,
> menuBar=0, width=300, height=250')" value="Submit">
> </div>
> </form>[/color]

The javascript: should be left out, it is superfluous.

You are asking for an empty window with the onclick, why?

[color=blue]
> When I click on submit, everything is fine, a popup opens and the
> result of the form is printed in it.
> If I press ENTER, there's a new window opening but it's not the window
> in OnClick[/color]

Yes it is.

<input onclick="window.open('');return false">

would ONLY open an empty window.

<input onclick="window.open('');return true">

would FIRST open an empty window, and the form-submit window ALSO.



--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Closed Thread