Javascript and Forms

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sylvain Perreault

    Javascript and Forms

    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="javasc ript:window.ope n('','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


  • Evertjan.

    #2
    Re: Javascript and Forms

    Sylvain Perreault wrote on 15 feb 2004 in comp.lang.javas cript:
    [color=blue]
    > onClick="javasc ript:window.ope n('','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>[/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('');retur n false">

    would ONLY open an empty window.

    <input onclick="window .open('');retur n 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)

    Comment

    Working...