jquery masked input plugin on input event not firing

Hi experts,

I'm using the jquery Masked Input Plugin located at this website:

This is the version I'm using:

Here is my working fiddle:


So when you run this fiddle you will a page that looks like this:

when I run my page
On page load a textbox with id="FormatTextBox" right underneath the dropdownlist is hidden.
When I select an item from the dropdownlist, the textbox becomes visible and has the masking applied to it.
So from the drop down list you can either choose Phone Number and Social.

Also, on page load the blue button is disabled and an image in the shape of a star is also hidden.

Also on the page is another textbox called id="TestTextBox" . This textbox is visible at all times and is located right under the text that says "This is a TextBox".
If you notice, when you start typing in this textbox, the button becomes enabled and the star image becomes visible. So then it looks like this:

when I start typing in the text box with id="TestTextBox"
I want the masked textbox called id="FormatTextBox" to function just like the text box called id="TestTextBox".

When I start typing in the Masked Textbox the button is not being enabled and the star image isn't displayed.
It seems like the masking is preventing the on input event from firing. Because if I remove the masking from that same textbox then the on input event works fine.:

            $('#FormatTextBox').on('input', function (e) {

                // show image

                // enable the button with id of Button1
                $('#Button1').prop('disabled', false);

Anyone know why the on input event on my masked textbox called id="FormatTextBox"  shown on my fiddle above?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RobOwner (Aidellio)Commented:
sounds like it's overwriting it. what happens if you initialize the two events around the other way?
maqskywalkerAuthor Commented:
my mistake the correct fiddle is this one.

maqskywalkerAuthor Commented:
I'm doing the masking for my textbox called id="FormatTextBox"  like this on the dropdownlist's change event:

            $('#FormatDDL').change(function () {

                // textbox is hidden by default
                // show textbox on change of dddl

                if ($('#FormatDDL option:selected').val() == '1') {
                    // clear value in textbox
                    $('.FormatTextBox').val(""); // clear out the textbox value
                    $('.FormatTextBox').attr('placeholder', '(###)###-####'); // add placeholder to textbox
                    // 1 - FEIN - Federal Tax Id Number
                    $(".FormatTextBox").mask("(999)999-9999"); // set textbox mask
                } else {                    
                    // clear value in textbox
                    $('.FormatTextBox').attr('placeholder', '###-##-####');
                    // 2 - SSN - Social Security Number

So on the change event of the dropdownlist depending on the item chosen, it applies the masking.

If I remove the masking by commenting out the if else statement doing the masking then the on input event of the textbox fires.
RobOwner (Aidellio)Commented:
avoid using the input event.

http://jsbin.com/sulima/1/edit?js,output shows how you can use the keyup event to the same effect

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.