timsavage / django-ajax-forms

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

Method to check existance of a field bugged #16

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
If you want to validate a form with rules for field wich are not in the form, 
you have a javaScript error, and you can't send your form.
This is because the way the existance of fields are checked : 
$('not-existing-selector') is always an objet, so 
if($('not-existing-selector')) is always true.

What is the expected output? What do you see instead?
The way to check the existance of a field, in jQuery, is to check the length of 
the object.

What version of the product are you using? On what operating system?
Version: 0.2

Please provide any additional information below.
I Attached my fix as a mercurial diff file.

Original issue reported on code.google.com by tomina...@gmail.com on 14 Mar 2011 at 8:13

GoogleCodeExporter commented 9 years ago
Please attach the diff, this is not a use-case I considered.

Original comment by Sle...@gmail.com on 20 Jan 2012 at 1:50

GoogleCodeExporter commented 9 years ago

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