distinct() does not calculate correct collision input fields
posiczko opened this issue · 3 comments
Ooops, seems like google repo is no longer used. Moving issue #61 here.
How to replicate issue
- Set up a table with a number of input fields in various columns, like http://pastie.org/2754304 or see attached table.html
- Run validation with:
$.validity.setup({ outputMode:"label" });
$.validity.start();
$('#group_table input:not([id_=member_Bounced]').require();
$('#group_table input:not([id_=member_Bounced]').match("email");
$('#group_table input:not([id*=member_Bounced]').distinct("Members must be unique.");
result = $.validity.end();
- What is the expected output? What do you see instead?
Colliding fields are ones with input of member1@example.com, however field with member4@example.com is chosen as conflicting one (see output here and here). Could it be that id of input fields containing wonky brackets causes confusion? - SW versions: Validity 1.2.0 with Jquery 1.6.4
Thank you for your help!
--p
PS
Thanks for this fantastic tool!
Not sure if this is the problem, bust your jquery selector syntax appears to be incorrect:
#group_table input:not([id*=member_Bounced]
is missing a closing paren.
Indeed, the syntax is incorrect. It should have been:
$.validity.setup({ outputMode:"label" });
$.validity.start();
$('#group_table input:not([id_=member_Bounced])').require();
$('#group_table input:not([id_=member_Bounced])').match("email");
$('#group_table input:not([id*=member_Bounced])').distinct("Members must be unique.");
result = $.validity.end();
Must have cut & pasted it incorrectly.
The error still persists, as conflicting inputs fields should be ones containing member1@example.com not member6@example.com.
Any ideas? My JS is a bit rusty and I'd be happy to donate frosty beverages for the fix. 8-)
Thanks for help,
--p
PS
Interestingly gist editor is interpreting star in the code block in require and match statements.
Hohum. Tried to simplify the problem to eliminate complex ids and other noise. The issue still persists. See https://gist.github.com/1344182