469,323 Members | 1,493 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,323 developers. It's quick & easy.

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.
Jul 28 '08 #1
1 1737
vunet wrote:
...if any onsubmit handlers/events allow form submission but my
component does not allow submission, then do NOT submit the form.
<news:c7**********************************@f63g200 0hsf.googlegroups.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
Jul 28 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by cruiserweight | last post: by
32 posts views Thread by Eli | last post: by
14 posts views Thread by Kenneth Keeley | last post: by
3 posts views Thread by davidjcampos | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by mdpf | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.