Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: Cannot read property 'toLowerCase' #34

Closed
jonhue opened this issue May 10, 2017 · 2 comments
Closed

Uncaught TypeError: Cannot read property 'toLowerCase' #34

jonhue opened this issue May 10, 2017 · 2 comments

Comments

@jonhue
Copy link

jonhue commented May 10, 2017

Uncaught TypeError: Cannot read property 'toLowerCase' of undefined
    at jQuery.fn.init.val (jquery.self-bd7ddd393353a8d2480a622e80342adf488fb6006d667e8b42e4c0073393abee.js:8201)
    at applicationUsersRegisterIndexValidateUsername (index.self-1ec7504e1c62604622326b3b5cb2feeaaf573eaf947a783c2b32784ce33aa2d2.js:27)
    at HTMLInputElement.callback (index.self-1ec7504e1c62604622326b3b5cb2feeaaf573eaf947a783c2b32784ce33aa2d2.js:10)
    at checkElement (jquery.typewatch.self-c0e2658d2eb4075588545012bae9e075cce3c801af9b0720461d040daa5e5184.js:50)
    at timerCallbackFx (jquery.typewatch.self-c0e2658d2eb4075588545012bae9e075cce3c801af9b0720461d040daa5e5184.js:88)

Issue seems to be in jquery.typewatch.js:50 or jquery.typewatch.js:88

@jonhue
Copy link
Author

jonhue commented Jun 9, 2017

Here is my initialization:

applicationUsersRegisterIndexInitTypewatch() runs whenever the page loads.

function applicationUsersRegisterIndexInitTypewatch() {
    var applicationUsersRegisterIndexTypewatchOptions = {
        callback: function() {
            applicationUsersRegisterIndexValidateUsername();
        },
        wait: 750,
        highlight: true,
        allowSubmit: false,
        captureLength: 2
    };

    $('[data-validate]').typeWatch(applicationUsersRegisterIndexTypewatchOptions);
};



function applicationUsersRegisterIndexValidateUsername() {
    var $this = $(this);

    $.get( $this.data('validate'), {
        username: $this.val()
    }).success(function() {
        $this.addClass('valid').parent().removeClass('field_with_errors');
        $this.closest('form').find('[type="submit"]').removeClass('disabled');
    }).error(function() {
        $this.removeClass('valid').parent().addClass('field_with_errors');
        $this.closest('form').find('[type="submit"]').addClass('disabled');
    });
};

@jonhue
Copy link
Author

jonhue commented Jun 10, 2017

the issue was unrelated to typewatch.

@jonhue jonhue closed this as completed Jun 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant