Copy Form's onSubmit() Handlers and Add More

V

vunet

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.
 
T

Thomas 'PointedEars' Lahn

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

<
Note the date.


HTH

PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,522
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top