Javascript and Forms

Discussion in 'Javascript' started by Sylvain Perreault, Feb 15, 2004.

  1. 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
    Sylvain Perreault, Feb 15, 2004
    #1
    1. Advertising

  2. Sylvain Perreault

    Evertjan. Guest

    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.



    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Feb 15, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brendan Miller

    Web Forms VS Windows Forms

    Brendan Miller, Aug 11, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    5,077
    Kevin Spencer
    Aug 11, 2003
  2. Eric
    Replies:
    2
    Views:
    1,457
    Tommy
    Feb 13, 2004
  3. JEFF
    Replies:
    1
    Views:
    1,014
    =?Utf-8?B?YnJpYW5zW01DU0Rd?=
    Nov 12, 2007
  4. Toni Pohl
    Replies:
    1
    Views:
    936
    Toni Pohl
    Aug 10, 2008
  5. Eric
    Replies:
    2
    Views:
    499
Loading...

Share This Page