Object doesn't support property or method

Discussion in 'Javascript' started by Charles, Feb 28, 2007.

  1. Charles

    Charles Guest

    I have a validation script used before submitting a form. When
    executed it says "Object doesn't support property or method". I'm
    using onclick="return validate();" which should be fine. But when you
    click "Submit", you get this error: http://www.auriance.com/docs/tmp/nutrinat/pedido_.php
    Any idea?
    Thanks,
     
    Charles, Feb 28, 2007
    #1
    1. Advertising

  2. Charles

    RobG Guest

    On Feb 28, 11:05 am, "Charles" <> wrote:
    > I have a validation script used before submitting a form. When
    > executed it says "Object doesn't support property or method". I'm
    > using onclick="return validate();" which should be fine. But when you
    > click "Submit", you get this error:http://www.auriance.com/docs/tmp/nutrinat/pedido_.php
    > Any idea?
    > Thanks,


    Here:

    <input name="submit" type="submit" class="send" id="send"
    onclick="return validate();" value="Concluir pedido" />

    Firstly, assign the validation function to the form's submit
    attribute, then when it returns false it will stop the form
    submitting.

    Secondly, by calling the button 'submit' you mask the form's submit
    method. Don't give control's a name unless you intend to submit its
    value with the form, and never call a control "submit" (or reset or
    any other method or property of a form).

    When your functions calls "form.submit()" it is trying to execute the
    button, not the form's submit method.


    --
    Rob
     
    RobG, Feb 28, 2007
    #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. todd
    Replies:
    3
    Views:
    5,871
  2. Roman
    Replies:
    0
    Views:
    4,064
    Roman
    Jan 4, 2004
  3. zdrakec
    Replies:
    0
    Views:
    611
    zdrakec
    Sep 26, 2007
  4. Joe
    Replies:
    3
    Views:
    567
  5. JohnE
    Replies:
    1
    Views:
    1,081
    JohnE
    Mar 9, 2010
Loading...

Share This Page