473,385 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 1922
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: cruiserweight | last post by:
I've constructed this form so that if Javascript is disaabled it will show a typical <input type="submit"> button, BUT using the <noscript> tag. Why is this a problem and what's a viable solution?...
14
by: Oleg | last post by:
Hello there: I've been trying to create two different sets of required fields in one form and to use a radiobutton as sort of a switcher between these sets. In my HTML form there are two...
32
by: Eli | last post by:
How can I POST a form into a new window where I control the size and other attributes of the new window? Also. Are there any implications, perhaps due to browser security (Interne Explorer?)...
3
by: n3mtkj3mzsir0cy | last post by:
I have created web pages that do client-side form validation using the onclick directive. E.g., <form action=other_page.cgi method=post> Enter your age: <input name=age> <input type="submit"...
14
by: Kenneth Keeley | last post by:
Hi How can I run a java script function before a form is submited back to the server. What I wish to do is have a upload form that when a user clicks the submit button a javascript function opens...
2
by: Wysiwyg | last post by:
I'm going back to a previous asp.net (C#) web project after a few months of inactivity and my first form, the login, won't submit. I ran with the debugger and still can't see how to resolve this. I...
17
by: emma.sax | last post by:
Hi all, I have a form where we would like the user to input their email address twice, to ensure they've typed it correctly, as is found on most sign-ups I'm looking for a solution to the...
3
by: davidjcampos | last post by:
I'm a definite newbie to javascript, but I have put together some workable code from several different examples on the web. I am using both "onchange" event handlers as well as an "onsubmit" event...
1
by: gbezas | last post by:
Hi All, I have added an event handler to redirect form.submit() to a newSubmit() method that I have defined (which does some additional processing before submitting the form). Additionally I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.