Javascript and Forms

S

Sylvain Perreault

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','toolbar=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
 
E

Evertjan.

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

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

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

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

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top