Water Cooler v2 said the following on 4/18/2006 10:25 AM:
> Is it necessary to return a value from the event handlers?
No. But it depends on what you are trying to do with the event handler
and what the elements default behavior is. Not returning true or false
from an onsubmit handler defeats the purpose of using it. But returning
true/false from the onclick of a Button element wouldn't serve any purpose.
> For instance, what does the return value in the following code signify?
> What will be its impact if it returned otherwise (true)?
Put two links on a page, one with return true and one with return false.
Then mouse over them and see what is different.
> <a href="http://www.w3schools.com"
> onmouseover="alert('An onMouseOver event'); return true">
> <img src="Click.gif" width="100" height="30">
> </a>
<a href="http://www.w3schools.com"
onmouseover="alert('An onMouseOver event'); return true">
<img src="Click.gif" width="100" height="30">
</a>
<a href="http://www.w3schools.com"
onmouseover="alert('An onMouseOver event'); return false">
<img src="Click.gif" width="100" height="30">
</a>
And then mouseover them and observe the browser. Nothing better than
testing code to see what it does
--
Randy
comp.lang.javascript FAQ -
http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices -
http://www.JavascriptToolbox.com/bestpractices/