Trying to attach a keydown handler to an input element that doesn't break in ie7

91 views Asked by At

I am trying to attach a keydown handler to all input[type=text/password/email] elements within a validation group that won't break in ie7.

Here's what I've tried:

$(function() {
            $('.validationGroup input[type=text],\
                .validationGroup input[type=password],\
                .validationGroup input[type=email],\
                .validationGroup input[type=tel],\
                .validationGroup .causesValidation\
                ').keydown(UCP.validation.keyDownEventHandler);
        });

Any ideas?

1

There are 1 answers

0
yowainwright On BEST ANSWER

I added the Keydown event on the document and it worked.

 $(document).keydown(function () {
            $('.validationGroup input[type=text],\
            .validationGroup input[type=password],\
            .validationGroup input[type=email],\
            .validationGroup input[type=tel],\
            .validationGroup .causesValidation\
            ').on(UCP.validation.keyDownEventHandler);
        });