timsavage / django-ajax-forms

Automatically exported from code.google.com/p/django-ajax-forms
Other
1 stars 1 forks source link

javascript failure while attaching validation events #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Extend javascript Array prototype.
2. On the browser when attaching validation events, the script fails.

The issue is because of the way "opts.validation_events" javascript array is 
being iterated. The line 32 in jquery.ajax_forms.js should be:

"for (var idx = 0, j < opts.validation_events.length; i < j; idx++) {" 

Original issue reported on code.google.com by rockrai...@gmail.com on 21 Aug 2010 at 9:50

GoogleCodeExporter commented 9 years ago
Had the same issue (only in Chrome for some reason).
Why not simply do this:

for (var idx = 0; idx <  opts.validation_events.length; idx++) {

?

Original comment by guyk...@gmail.com on 12 Oct 2010 at 3:19

GoogleCodeExporter commented 9 years ago
All the iteration is actually not that good. jsLint is not happy.

The JavaScript side of this app is more proof of concept than production ready.

Have stated replacing all loops with jQuery.each calls. As well as running all 
code through jslint.

Original comment by Sle...@gmail.com on 20 Jan 2012 at 2:21

GoogleCodeExporter commented 9 years ago

Original comment by Sle...@gmail.com on 20 Jan 2012 at 3:27

GoogleCodeExporter commented 9 years ago

Original comment by Sle...@gmail.com on 15 Oct 2013 at 5:27