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

TypeError: Cannot read property 'set' of undefined #112

Open
bebaps opened this issue Sep 7, 2019 · 5 comments
Open

TypeError: Cannot read property 'set' of undefined #112

bebaps opened this issue Sep 7, 2019 · 5 comments

Comments

@bebaps
Copy link

bebaps commented Sep 7, 2019

This is a valid issue, but I am posting this more as a heads up for future users of this plugin. There have been many issues already logged for this error, with no real resolution. It seems the author of this plugin is no longer actively maintaining it, so be aware that you will need to pretty much fend for yourself with any issues with this plugin.

Screen Shot 2019-09-06 at 5 13 41 PM

When trying to use the setList method you might run into this issue:

Screen Shot 2019-09-06 at 4 53 49 PM

In any case, if you receive this error as many others have, you will need to check two main things:

  1. jQuery can actually find the element it is to set values for
  2. The elements that you are settings values for are "registered" with this plugin

I say "registered" because this plugin uses its own system to clone the inputs found in the DOM. This list can be found in jquery.input.js, but here's a pic:

Screen Shot 2019-09-06 at 4 54 31 PM

In my code, I had this tel input that was causing the error:

Screen Shot 2019-09-06 at 4 54 08 PM

After a few frustrating hours and basically dissecting this entire plugins source code (hence how I found out how this plugin "registers" the inputs that it will actually work with), I found that simply changing that input from a tel to a text solved the problem

Screen Shot 2019-09-06 at 4 54 15 PM

I hope this saves someone the time and frustration.

@agengdp
Copy link

agengdp commented Nov 26, 2019

I already frustating, before I found this issue.
thank you for saving my life

@orhangazi
Copy link

Hey @bebaps, thanks for solution. You save my all day and painful head.

@shain-digix
Copy link

Hey @bebaps , thanks for the solution. You save my day as well.

@flavioludi
Copy link

Thank you, @bebaps :)

@bisma-im
Copy link

bisma-im commented May 5, 2024

omg thanks, i would've never been able to find this on my own. you're a lifesaver!!

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

6 participants