[Mono-dev] [PATCH] unbreak postbacks (fix for r70294)

joel reed joel.reed at ddiworld.com
Wed Jan 3 10:15:43 EST 2007


I've experienced this breakage too and fixed in my local tree, but 
haven't posted. Thanks for beating me to it.

Accd to:
http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Functions#Example:_Determining_whether_a_function_exists

This might be better:

if ((typeof ValidatorOnSubmit == 'function') && !ValidatorOnSubmit()) 
return;

instead of

if(document.ValidatorOnSubmit && !ValidatorOnSubmit()) return;

The typeof thing above is also what prototype.js does. Anyway, some 
check like this is needed for sure.

jr



Marek Habersack wrote:
> Hello,
> 
>   The diff applied in r70294 will cause the page to fail any postbacks
> done with JavaScript if validators are absent from the page. The
> attached diff adds a check for whether ValidateOnSubmit function is
> present in the document. Please review
> 
> best regards,
> 
> marek
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: joel.reed.vcf
Type: text/x-vcard
Size: 405 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20070103/d041a564/attachment.vcf 


More information about the Mono-devel-list mailing list