[Javascript] IE onclick problem

Cutter (JSRelated) java.script at cutterscrossing.com
Thu Apr 17 08:06:21 CDT 2008


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 "Cutter" Blades
Adobe Certified Professional
Advanced Macromedia ColdFusion MX 7 Developer
_____________________________
http://blog.cutterscrossing.com

tedd wrote:
> At 3:56 AM +0200 4/17/08, J. Lester Novros II wrote:
>> So I would argue that 'onsubmit="return checkMyForm()"' should read
>> 'onsubmit="checkMyForm()"' since the handler function itself returns a
>> true or false value to the onsubmit event, thereby cancelling or granting
>> the submit event.
> 
> 
> Well -- it doesn't work that way for me.
> 
> Here's a form where I use it:
> 
> http://webbytedd.com/c/form-submit/
> 
>   'onsubmit=return checkMyForm()" <-- works
> 
> where
> 
>   'onsubmit=checkMyForm()"  <-- doesn't
> 
> Or is there something here I'm not understanding?
> 
> Cheers,
> 
> tedd
> 




More information about the Javascript mailing list