473,231 Members | 2,048 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,231 software developers and data experts.

onsubmit() Vs submit()

Is there any distinction between
1.when a form is submitted by onsubmit() in the <form> tag itself &
2.by any other function in onClick in the <form> tag which contains the
code for the form submit as
document.<form name>.submit();

Apr 20 '06 #1
1 6352
st*********@gmail.com said on 20/04/2006 4:43 PM AEST:
Is there any distinction between
1.when a form is submitted by onsubmit() in the <form> tag itself &
The onsubmit attribute provides script to execute when the submit event
occurs, it does not submit the form.

If the submit event returns false, submission is canceled. If scripting
is disabled or not available, or the script fails for some reason, the
form should be submitted.

2.by any other function in onClick in the <form> tag which contains the
code for the form submit as
document.<form name>.submit();


This calls the submit method of the form which is effectively the same
as clicking a submit button. However, if scripting is disabled or not
available, or the script fails for some reason, or the form's submit
method has been masked by a control named 'submit', the form will *not*
be submitted.

It is a bad idea to make submission reliant upon the successful
completion of a script.
--
Rob
Group FAQ: <URL:http://www.jibbering.com/FAQ>
Apr 20 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Varun | last post by:
Hi There, I have a form("myRequest.asp") and the values from it are retrieved into the page ("output_Print.asp") on which I have two buttons('Save As Complete' and 'Save As Incomplete'). When the...
4
by: Stuart Wexler | last post by:
Hi, I have a form with onSubmit embedded in the <form> tag. The form is submitted programatically through javascript . While the form submits fine, nothing I'm doing seems to get it to...
4
by: Kai Grossjohann | last post by:
I have two frames. Frame "search" contains a search form specifying an onsubmit action like so: <form ... onsubmit="foo();"> ... </form> The other frame contains a <img ......
4
by: Bruce Duncan | last post by:
I just noticed that if I use a "submit" button the "onSubmit" function call will be invoked. But if I use a button to call some other javascript and at the end of that javascrip I do something...
2
by: JM Rosengard | last post by:
Hi, It seems that unlike other browsers, Safari will submit a form even when the onsubmit event handler returns false. e.g. <form onsubmit="return false" ...> Is there a workaround to prevent...
1
by: padew | last post by:
<form method="post" name="formWin" onSubmit="check();"> this work only if I send the form's datas directly with <input type=submit ...> if I use document.formWin.submit(); for to send the...
2
by: Sorrow | last post by:
If you have an onsubmit event handler defined for a form, it doesn't seem to trigger if you manually call the .submit() method of the form object. Is there any way you can make sure that code is...
1
by: vunet | last post by:
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...
2
by: rudiedirkx | last post by:
Gents, I have a problem (only in Safari) with the onsubmit in webforms. This topic covers the same subject: http://bytes.com/topic/javascript/answers/166542-onsubmit-safari but not as detailed as...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.