W3C home > Mailing lists > Public > www-html@w3.org > November 2004

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

From: David Lieberman AWDSF <david@awdsf.com>
Date: Mon, 15 Nov 2004 10:51:41 -0800
Message-Id: <200411151855.iAFItnx30364@server1.primalspace.net>
To: <www-html@w3.org>

I believe a) <form ... onSubmit="return checkData()"> is the "officially"
correct one!

David Lieberman
Wed Design Course Developer
http://www.awdsf.com  

-----Original Message-----
From: www-html-request@w3.org [mailto:www-html-request@w3.org] On Behalf Of
Sean Dockery
Sent: Friday, November 12, 2004 1:35 PM
To: www-html@w3.org
Subject: Question about which is the correct style of JavaScript to pass to
FORM's onSubmit attribute





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:49:28 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:16:01 GMT