Skip to content
This repository was archived by the owner on Dec 11, 2017. It is now read-only.
Closed
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
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,10 @@ This is a masked input plugin for the jQuery javascript library. It allows a use

* a - Represents an alpha character (A-Z,a-z)
* 9 - Represents a numeric character (0-9)
* \* - Represents an alphanumeric character (A-Z,a-z,0-9)
* \* - Represents an alphanumeric character (A-Z,a-z,0-9)

Events
--------

- `unmasked.maskedInput` is triggered when the input is blurred and the mask is cleared. If you're performing separate validation, it may be useful to bind validation to this event. For example, if you're checking whether a field is empty, you don't want to consider the temporary placeholders in a field. When this event is triggered, they will be gone.

4 changes: 3 additions & 1 deletion src/jquery.maskedinput.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,10 @@
})
.bind("blur.mask", function() {
checkVal();
if (input.val() != focusText)
if (input.val() != focusText) {
input.change();
input.trigger('unmasked.maskedInput');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this line supposed to be inside the if block? It is formatted to look that way but there are no braces.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, indeed. Thanks for noticing that.

}
})
.bind("keydown.mask", keydownEvent)
.bind("keypress.mask", keypressEvent)
Expand Down