Copy Form's onSubmit() Handlers and Add More

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

    Copy Form's onSubmit() Handlers and Add More

    I write a JS library component which is applied to every form on a
    webpage. The component does something before it submits the form. Now,
    let's say user has his own onSubmit() handlers returning true or
    false. I want to find a way to add my component's "onsubmit" event to
    the form without overwriting user-defined onSubmit() handlers or
    onsubmit events.
    Is there a really good way of doing this?

    The problem I've come across was if I add onsubmit event to the form
    which returns false (form should not be submitted), the user-defined
    onSubmit() handlers or onsubmit events may return true and submit the
    form. I want to prevent it with logic:

    ....if any onsubmit handlers/events allow form submission but my
    component does not allow submission, then do NOT submit the form.

    Thanks.
  • Thomas 'PointedEars' Lahn

    #2
    Re: Copy Form's onSubmit() Handlers and Add More

    vunet wrote:
    ...if any onsubmit handlers/events allow form submission but my
    component does not allow submission, then do NOT submit the form.
    <news:c7b0d4a 5-d7c3-4ffa-8c9b-2d02f7ca43eb@f6 3g2000hsf.googl egroups.com>

    Note the date.


    HTH

    PointedEars
    --
    realism: HTML 4.01 Strict
    evangelism: XHTML 1.0 Strict
    madness: XHTML 1.1 as application/xhtml+xml
    -- Bjoern Hoehrmann

    Comment

    Working...