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]

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

From: Asbjørn Ulsberg <asbjorn@tigerstaden.no>
Date: Mon, 15 Nov 2004 21:20:03 +0100
To: "Sean Dockery" <sdockery@securac.net>
Cc: "HTML List" <www-html@w3.org>
Message-ID: <opshiv3puouvpchu@quark>

On Fri, 12 Nov 2004 21:34:55 +0000, Sean Dockery <sdockery@securac.net>  
wrote:

> Which is the following is correct?
>
> a) <form ... onSubmit="return checkData()">
> b) <form ... onSubmit="return checkData();">
> c) <form ... onSubmit="checkData()">
> d) <form ... onSubmit="checkData();">

Either (a) or (b). The semicolon is just a statement terminator and can be  
used to separate several function calls within one single event, if you'd  
like. Hence is the semicolon optional, but not «wrong» to have there  
either.

Neither (c) or (d) should work, imho.

> Does anyone know which is correct?

I don't have any exact knowledge on the matter, but it makes the most  
sence that the value from 'checkData()' is returned to the bubbling event.  
If you don't return it, it should imho act as a 'void'.

-- 
Asbjørn Ulsberg     -=|=-    http://virtuelvis.com/quark/ 
«He's a loathsome offensive brute, yet I can't look away»
Received on Monday, 15 November 2004 20:18:55 GMT
Valid XHTML 1.0! Valid CSS! Site Map | Privacy Policy | Terms of Use | WebHeadStart.org © 2005 All Rights Reserved.