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

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 UTC