Welcome to WebHeadStart.org

Web Technologies

Sponsored By

WebHeadStart.org is currently in beta.
Please pardon our appearance as we work to provide you with the most comprehensive reference on today's web technologies.

Interested in advertising on WebHeadStart? Become an advertising partner today!

[WWW-HTML Mailing List Archive Home] [Messages By Thread] [Messages By Date]

Question about which is the correct style of JavaScript to pass to FORM's onSubmit attribute

From: Sean Dockery <sdockery@securac.net>
Date: Fri, 12 Nov 2004 21:34:55 +0000
To: www-html@w3.org
Message-ID: <cn39cq$qcu$1@sea.gmane.org>




Which is the following is correct?

a) <form ... onSubmit="return checkData()">

b) <form ... onSubmit="return checkData();">

c) <form ... onSubmit="checkData()">

d) <form ... onSubmit="checkData();">

....where checkData is a JavaScript function that returns a true or false 
value.

It seems that Internet Explorer accepts all of the above, but I'm not 
taking that to mean that all are correct.

I've attempted to search the W3 web site on the terms form and onsubmit, 
but the documentation refers to the attribute value as being an intrinsic 
event (without giving any examples).  The archived mailing lists contain 
messages which demonstrate all of the options that I've provided above.  I 
gave up after the forth page of search results because of the number of 
conflicting examples.

Does anyone know which is correct?

Thanks for your precious time.
Received on Monday, 15 November 2004 18:24:53 GMT
Valid XHTML 1.0! Valid CSS! Site Map | Privacy Policy | Terms of Use | WebHeadStart.org © 2005 All Rights Reserved.