Browse Source

Typo in form rule

pull/2228/merge
jlukic 9 years ago
parent
commit
9db217558e
1 changed files with 14 additions and 14 deletions
  1. 28
      src/definitions/behaviors/form.js

28
src/definitions/behaviors/form.js

@ -1129,20 +1129,20 @@ $.fn.form.settings = {
},
// matches another field
different: function(value, fieldIdentifier) {
different: function(value, identifier) {
// use either id or name of field
var
$form = $(this),
matchingValue
;
if( $('[data-validate="'+ fieldIdentifier +'"]').length > 0 ) {
matchingValue = $('[data-validate="'+ fieldIdentifier +'"]').val();
if( $('[data-validate="'+ identifier +'"]').length > 0 ) {
matchingValue = $('[data-validate="'+ identifier +'"]').val();
}
else if($('#' + fieldIdentifier).length > 0) {
matchingValue = $('#' + fieldIdentifier).val();
else if($('#' + identifier).length > 0) {
matchingValue = $('#' + identifier).val();
}
else if($('[name="' + fieldIdentifier +'"]').length > 0) {
matchingValue = $('[name="' + fieldIdentifier + '"]').val();
else if($('[name="' + identifier +'"]').length > 0) {
matchingValue = $('[name="' + identifier + '"]').val();
}
else if( $('[name="' + identifier +'[]"]').length > 0 ) {
matchingValue = $('[name="' + identifier +'[]"]');
@ -1154,20 +1154,20 @@ $.fn.form.settings = {
},
// matches another field
match: function(value, fieldIdentifier) {
match: function(value, identifier) {
// use either id or name of field
var
$form = $(this),
matchingValue
;
if( $('[data-validate="'+ fieldIdentifier +'"]').length > 0 ) {
matchingValue = $('[data-validate="'+ fieldIdentifier +'"]').val();
if( $('[data-validate="'+ identifier +'"]').length > 0 ) {
matchingValue = $('[data-validate="'+ identifier +'"]').val();
}
else if($('#' + fieldIdentifier).length > 0) {
matchingValue = $('#' + fieldIdentifier).val();
else if($('#' + identifier).length > 0) {
matchingValue = $('#' + identifier).val();
}
else if($('[name="' + fieldIdentifier +'"]').length > 0) {
matchingValue = $('[name="' + fieldIdentifier + '"]').val();
else if($('[name="' + identifier +'"]').length > 0) {
matchingValue = $('[name="' + identifier + '"]').val();
}
else if( $('[name="' + identifier +'[]"]').length > 0 ) {
matchingValue = $('[name="' + identifier +'[]"]');

Loading…
Cancel
Save