[Javascript] IE onclick problem

tedd tedd at sperling.com
Thu Apr 17 09:14:41 CDT 2008


At 8:06 AM -0500 4/17/08, Cutter (JSRelated) wrote:
>There must be something you're misunderstanding. I have hundreds of
>forms out there with onsubmit="validate()" (before I knew better). The
>validate function returns true or false, which either cancels the event
>or allows it depending on that return.
>
>Create a quick test case:
>
>function checkMyForm(){
>       return false; // Manually toggle this for your test
>}
>
>Then make a quick test form with onsubmit="checkMyForm()" to see what
>happens. Don't even worry about logic or other functionality right now,
>just the quick test case...

Steve:

A simple one entry won't demonstrate the problem. Please follow:

http://webbytedd.com/ccc/test-onsubmit/index.php

Form One uses the onsubmit="return checkForm(this);" where as Form 
Two uses onsubmit="checkForm(this);"

Now, without entering anything click the top Submit button. An alert 
will ask you to enter something in Anything 1.

Enter something and click Submit again. An alert will ask you to 
enter something in Anything 2.

Enter something and click Submit again. At this time the form will process.

Now, without entering anything click the bottom Submit button. An 
alert will ask you to enter something in Anything 1.

Enter something and click Submit again. An alert will ask you to 
enter something in Anything 1. BUT, please note that the form 
processed before having both fields populated -- not desired.

As you can see, the performance of these two are not the same.

Now, what am I misunderstanding?

Cheers,

tedd
-- 
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20080417/44b279cf/attachment.htm>


More information about the Javascript mailing list