Skip to content

Commit

Permalink
#20 Radio-Button fix by felly
Browse files Browse the repository at this point in the history
  • Loading branch information
terrylinooo committed Dec 16, 2018
1 parent ffd8133 commit 334a87e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion docs/assets/js/jquery.disableAutoFill.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

var realPassword = [];
var realFields = [];
var realFieldsMapper = {};

// An Object for Helper functions.
var _helper = {};
Expand Down Expand Up @@ -121,7 +122,13 @@
_helper.randomizeInput = function(obj, settings) {
obj.find('input').each(function(i) {
realFields[i] = $(this).attr('name');
$(this).attr('name', Math.random().toString(36).replace(/[^a-z]+/g, ''));
if(realFieldsMapper[realFields[i]]) {
$(this).attr('name', realFieldsMapper[realFields[i]]);
} else {
var randomName = Math.random().toString(36).replace(/[^a-z]+/g, '');
$(this).attr('name', randomName);
realFieldsMapper[realFields[i]] = randomName;
}
});
};

Expand Down
2 changes: 1 addition & 1 deletion docs/assets/js/jquery.disableAutoFill.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/jquery.disableAutoFill.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 334a87e

Please sign in to comment.