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
parsley().on('field:success') not working #991
Comments
I don't know either. It works. The reasons why we ask in our contributing guidelines to provide a working example (say in
|
It does not work here is the code - https://jsfiddle.net/marcandre/1tk9o2te/ |
The on('field:success') needs to be submitted but it worked just fine on user input? |
I don't follow. In the fiddle I gave, enter "blah" in the input, press submit, this validates the form, you'll get the alert... How does this not work, exactly? |
I had it working without the submit, when you input your values the input field is validated and then success function runs. But this stopped working with the latest jquery version it's not validated on user input anymore $('#quantity').parsley().on('field:success', function() {
console.log('success');
}); |
Validation does not happen at first until you submit. After that, error fields get revalidated often to try to clear the errors. I think having a |
Yes I trigger runs the validation which is what I did and now it's not working the trigger is not happing |
You can see it in the examle under the email field I'm not required to sumbit to see the error - http://parsleyjs.org/doc/examples/simple.html |
The issue is that Does not work, if I use listen it's fine |
In your jsfiddle example, you are binding the form with You should either specify it in the data attributes (like here) or use the following code: |
Okm yea that is very confushing and I take it this new I had no issues with this before I updated the version. I can't add it to the data attributes as I have different JS checks the only option is "$('#create-post').parsley().options.trigger = 'change';" However this does not work as you can see here - https://jsfiddle.net/chfpm37h/1/ |
This is somewhat of a major problem, if javascript options are ignored how can run the following validation which is triggered when a user clicks the next button the form wizard onNext: function( tab, navigation, index, newindex ) {
var current = index, next = current + 1;
if (next > current) {
console.log('aaaa');
//console.log(current + ' ' + next);
//console.log( $('#create-post').parsley());
if (false === $('#create-post').parsley().validate('step' + current)) {
console.log('bbb');
return false;
}
}
}, |
Mmm, right, in your last fiddle the trigger option, you'll also need to call
Normally it's a method you don't need to call, since Parsley does it for you before validating, but here... parsley isn't validating yet on 'change', so you need to call it. So, just to be clear: javascript options are not ignored, and are actualized before any validation automatically. |
That does not work, just tested it - https://jsfiddle.net/chfpm37h/2/ |
I don't understand if there not ignored then why isn't the following not getting called |
Any updates on this, still not working on my end or on js fiddle $('#create-post').parsley().options.trigger = 'change'; |
Any news regarding this, it's still not working |
Oh man, I'm sorry, I was wrong, again... So, here's a working fiddle, using |
This is working great on jsfiddle but not in my app? I have it in bootstrap wizard and I'm using MeteorJS |
@marcandre from what I can tell this only happens from parsely.js 2.1.0 and up, in 2.0.7 it's firing the trigger event I am getting a different error - #995 In version 2.1.0 and up in MeteorJS and Jquery 1.11.4 Does not work |
As I wrote, use
|
@marcandre I used reset, my mistake in what I pasted reset still does not work |
@marcandre any ideas what might be the issue? |
@marcandre really appreciate the help, I finally was able to get to the bottom of this. It's a conflict issue with the meteor package active router meteor-activeroute/legacy#43 |
No the issue 100% on my end I had create-post id twice |
Really not sure what's going on, I'm using the latest version of jquery and it's possible there is some kind of conflict.
But the following is not working or being fired
But this does work
I see the validation
The text was updated successfully, but these errors were encountered: