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

Cannot read property 'name' of undefined #23

Open
deJong-IT opened this issue Mar 29, 2013 · 4 comments
Open

Cannot read property 'name' of undefined #23

deJong-IT opened this issue Mar 29, 2013 · 4 comments

Comments

@deJong-IT
Copy link

Sometimes when skipping a step with checkboxes in it, the validation will return an error:
Uncaught TypeError: Cannot read property 'name' of undefined

I'm not sure why this happens, the field does have the property 'name', but I solved it by an extra try/catch on line 290:

try {var fieldIsValid = $validate.element($(this));}catch (error){}
@wbotelhos
Copy link
Owner

Hi,

It is about jQuery Validation.
I'll drop this integration and use jQuery Validaty, where I'll be able to commit on every bug or feature.
The people of jQuery Validation did not accept my advice and pull request, so I maked it.

But I think it is related with hidden fields.

@deJong-IT
Copy link
Author

Thanks for your fast response.

I'm not sure if it's just the hidden fields. The problem went away when i removed the checkboxes. But you are right, it's not your problem, it's a bug in the JQuery Validation plugin.

The reason I use JQuery Validation is that it can read html5 tags like url, email and required. If I read the Validaty documentation correct you have to do it all manually. And if you use a lot of forms that's not really an easy way to do.

But if you do switch to Validaty I'll look if it is possible for me to make an easy switch and change with you.

Thanks again for the great Stepy plugin!

Jeroen

@wbotelhos
Copy link
Owner

jQuery Validaty will support everything that jQuery Validation supports.
It just about time. I'm refactoring the both plugins (Stepy and Validaty).
Validation gave me a lot of headache.
Support automatic validations is easy, relax, I'll do a better validation plugin based on other's errors.
By the way, when a drop the support, you can continuing to use any plugin you want to validate, inside the back and next callback, just returning true or false to change or avoid the step change.

@farrukhsubhani
Copy link

I think thats a good idea. What I did was basically set the validation from stepy to false and then on next function i have a function that checks stepisValid( index) and i pass in index of the step it has come through and this function returns true or false which i eventually return to stepy. so that way i can use any plugin, custom script or validation or validity whatever to check if things are valid even if they are hidden inputs or not.
Nice work. keep it going

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

3 participants