Beginner question: form submit

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • soup_or_power@yahoo.com

    Beginner question: form submit

    My form looks as follows. Why isn't the function Validate called when
    the function test is called? Thanks for your help!!

    function Validate()
    {
    alert("in validate");
    }

    function test()
    {
    //do something
    document.forms[0].submit;
    }
    <FORM method="POST" onsubmit="retur n Validate()">
    ....
    <input type=text value="xyz" onclick="test() ">
    </FORM>

  • LV_Indy

    #2
    Re: Beginner question: form submit

    Because you aren't calling submit as a function:

    document.forms[0].submit();

    You are basically asking if submit exists, which is does. But you are
    doing nothing with it, so nothing's happening.

    Comment

    • soup_or_power@yahoo.com

      #3
      Re: Beginner question: form submit

      The lack of paranetheses was my typo. Thanks for your reply.

      Comment

      Working...