Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

Non type:submit input/button #165

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dist/validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@
Validator.prototype.toggleSubmit = function () {
if(!this.options.disable) return

var $btn = $('button[type="submit"], input[type="submit"]')
var $btn = $('button[type="submit"], [data-validator="submit"], input[type="submit"]')
.filter('[form="' + this.$element.attr('id') + '"]')
.add(this.$element.find('input[type="submit"], button[type="submit"]'))
.add(this.$element.find('input[type="submit"], [data-validator="submit"], button[type="submit"]'))

$btn.toggleClass('disabled', this.isIncomplete() || this.hasErrors())
}
Expand Down Expand Up @@ -254,7 +254,7 @@
.html(originalContent)
})

this.$element.find('input[type="submit"], button[type="submit"]').removeClass('disabled')
this.$element.find('input[type="submit"], [data-validator="submit"], button[type="submit"]').removeClass('disabled')

this.$element.find('.has-error').removeClass('has-error')

Expand Down
2 changes: 1 addition & 1 deletion dist/validator.min.js
100644 → 100755

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

6 changes: 3 additions & 3 deletions docs/dist/validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@
Validator.prototype.toggleSubmit = function () {
if(!this.options.disable) return

var $btn = $('button[type="submit"], input[type="submit"]')
var $btn = $('button[type="submit"], [data-validator="submit"], input[type="submit"]')
.filter('[form="' + this.$element.attr('id') + '"]')
.add(this.$element.find('input[type="submit"], button[type="submit"]'))
.add(this.$element.find('input[type="submit"], [data-validator="submit"], button[type="submit"]'))

$btn.toggleClass('disabled', this.isIncomplete() || this.hasErrors())
}
Expand Down Expand Up @@ -254,7 +254,7 @@
.html(originalContent)
})

this.$element.find('input[type="submit"], button[type="submit"]').removeClass('disabled')
this.$element.find('input[type="submit"], [data-validator="submit"], button[type="submit"]').removeClass('disabled')

this.$element.find('.has-error').removeClass('has-error')

Expand Down
Loading