-
Notifications
You must be signed in to change notification settings - Fork 57
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
Function for custom event doesn't work #147
Comments
Hi, On my side, I'm observing that jsFormValidator function is defined in this little code: |
Hey Marc, thanks for your message!
I did the same workaround like you. I've copied the JS Code straight in front of my validation code and now it's working for me. Unfortunately I ran into another issue :/ i have a 5 steps form and when I click on the back button it routes forward:/
I think someone posted an issue with a problem with 2 forms on the same page - maybe search for it could help you 😊.
Best regards,
Isabelle
Outlook for Android<https://aka.ms/ghei36> herunterladen
Von: Marc
Gesendet: Donnerstag, 31. Mai, 00:03
Betreff: Re: [formapro/JsFormValidatorBundle] Function for custom event doesn't work (#147)
An: formapro/JsFormValidatorBundle
Cc: isabelle112, Author
Hi,
I'm fighting with the same problem. Did you find some workarounds since your post ?
On my side, I'm observing that jsFormValidator function is defined in this little code:
if(window.jQuery) { (function($) { $.fn.jsFormValidator = function(method) { if (!method) { return FpJsFormValidator.customizeMethods.get.apply($.makeArray(this), arguments); } else if (typeof method === 'object') { return $(FpJsFormValidator.customizeMethods.init.apply($.makeArray(this), arguments)); } else if (FpJsFormValidator.customizeMethods[method]) { return FpJsFormValidator.customizeMethods[method].apply($.makeArray(this), Array.prototype.slice.call(arguments, 1)); } else { $.error('Method ' + method + ' does not exist'); return this; } }; })(jQuery); }
I've just copied the definition of the function in my js code just before doing treatment on customized events with $('form').find('input[type=text], textarea') .blur(function(){ // Run validation for this field $(this).jsFormValidator('validate') and that worked for one form but not the other one (I have 2 modal forms in my page). Maybe that could help in your case.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#147 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AWokSXoJdbUH7wWvTK7u3cfxikTVKp0Jks5t3xcegaJpZM4Tbnz3>.
|
Hi,
I am using the bundle for validating my symfony form. Everything works fine but now I need to validate at a custom event. I've tried to use the code from the readme file number 12, but I get the error, that
$('form').find('input[type=text], textarea') .blur(function(){ // Run validation for this field $(this).jsFormValidator('validate'); }).focus(function() { // Reset markers when focus on a field $(this).removeClass('error'); $(this).removeClass('ready'); }).jsFormValidator({'showErrors': function(errors){if (errors.length) { $(this).removeClass('ready'); $(this).addClass('error'); } else { $(this).removeClass('error'); $(this).addClass('ready'); }} });
this part of the code "is not a function". if I remove the last part from jsFormValidator({... I don't get an error.Could you please help me, where the issue is?
Thanks!
The text was updated successfully, but these errors were encountered: