Cannot submit Form if an error is corrected but can submit if no errors are made
-
Hello,
The form on our website cannot be submitted if someone makes an error when filling it and fixes it. If they make a mistake and the validation detects this, the only way for them to submit the form is to refresh the page, fill in the form from scratch without errors, and only then can they proceed to pay and the form be submitted correctly.
Hope you can help. Thank you.- This topic was modified 1 year, 5 months ago by Bran.
The page I need help with: [log in to see the link]
-
Hi @dinnershow
I hope you’re well today!
I visited the page and tried to test it by making some errors in the form (e.g. in phone number). Those were instantly marked as errors and even after clicking PayPal button and getting a general submission error, I still was able to correct these errors.
But I see how I couldn’t submit the form after that and I noticed and error from PayPal actually.
There’s a SERVICE_WORKER_NOT_ELIGIBLE error in one of PayPal scripts response and it seems to be related to “smartbuttons”. This same error doesn’t happen if the form is submitted with correct data in first attempt.
It would suggest that the issue is related to PayPal connection, which is getting incorrect data. Forminator itself doesn’t “cache” data and once fields are corrected, it would send that new data so it would seem to be some kind of a conflict here.
To start with: is there any caching enabled on site and/or server and if yes, can you try purging it and temporarily disabling to see if that makes any difference (especially if there is object cache active on server)?
Then, in “behavior” settings of the form there are two toggle switches: to prevent caching of page with the form (make sure that this is enabled) and to load form using ajax – this one, try to set it opposite to what it is set currently.
If none of that makes a difference – is there any other plugin on site that is/may be using PayPal in any way? If yes – what plugin is that?
Kind regards,
AdamThank you for your reply and help.
I did what you suggested.
I am using Litespeed , but disabled it
I changed the toggle switch to opposite, as suggested.
As far as I am aware, there are no other plugins using PayPal
Nothing changed and I keep getting the same error. The only way to submit the form is to make sure it is filled in correctly in the first place.
The plugin is fantastic and exactly what we need, but I really wish to solve this.
Regards
BHI @dinnershow
Thank you for response and checking that.
In this case, it would be good if we could take a closer look at the form itself and test it.
Could you export the form and share it with us?
Note: sharing the form will not share any of your PayPal data or existing submission data (we don’t need that either) – it will only share the form itself.
To share form:
– go to the “Forminator -> Forms” page in site’s back-end
– click on a little “gear” icon next to the form in question and select “Export” option
– copy given code and put it at https://pastebin.com
– share link to that paste in your response hereWe’ll then be able to import that form to test setup and review and test it to see if we can replicate the issue with it and if yes – what might be causing it.
Then, depending on that test, we’ll see what to do next to identify the problem and how to handle it.
Best regards,
AdamThank you once again:
So the link to pastebin is: https://pastebin.com/XVUgrJBN
Use this password: 0NP36i7J1z
Kindly note that I censored the emails current being used in the paste with ##### purposely since they are private.Thank you.
Hi Adam,
Are any updates on this issue please?
Regards
BHi @dinnershow
I hope you are doing well.
We were able to replicate this behaviour and notified Forminator team.
Could you please try this code:
<?php add_action('wp_footer', function () {?> <script> (function ($) { $(function () { $(document).on("validation:unhighlight", function (e, id) { let _any_error = $('.forminator-error-message'); if(_any_error.length == 0){ $('.forminator-button-submit').prop("disabled", false); } }); }); })(window.jQuery); </script> <?php }, 21);
Add it as a mu-plugin:
https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins
Let us know the result you got.
Best Regards
Patrick FreitasHello Patrick,
Thank you.
I added the mu file as indicated, but unfortunately the error still persists.
Regards
bH @dinnershow,
I can confirm the above snippet does work fine when tested in my system. Once you fill-up the required fields, the submit button will get enabled.
Maybe you are testing before filling up the required fields?
Another workaround would be to temporarily disable the Enable inline validation (as user types) option under the Behavior tab when you edit the form.
Please do check and let us know how that goes.
Best Regards,
Nithin
Hi Nithin,
Thank you.
I have tired it but it does not work. The problem does not seem to be with the submit field, but I am guessing the PayPal field, since the form on our website collects payments before it can be sent. When someone enters all the fields correctly, proceeds to the payment it works, but if they cancel the PayPal payment, they are redirected back to the form but if the press the pay with PayPal button again it gives an error and will not proceed to PayPal unless they refresh the page and fill out the form again from scratch. Then they can proceed to PayPal and pay.
For now as a temporary solution, I have added conditions to the PayPal field, so it shows and can be submitted only when all fields are filled. It is the only solution I found in order to be able to use your plugin on our site. But even then, if someone cancels payment on the PayPal form, they have to refresh the page and start again as I already explained. You can try it for yourself here: https://tinyurl.com/55xc99p4
The MU plugin snippet given is installed.
Forminator is the best plugin we found to suit our needs but I am afraid that we are getting to many people giving up on subscribing via the form and having to come to us directly. It doesn’t seem others have the same problem as we encountered so it puzzles us why. I hope to find a solution.
Thank you.
Regards
BHi @dinnershow
Thank you for response and additional description of the case.
In light of those new information, I must say it’s a bit different issue than we understood initially.
The problem here is partially related to how PayPal “interacts” with the form: the PayPal payment acts as submit button/confirmation so it’s only possible to submit the form if payment is successful. But if somebody cancels payment, PayPal returns information of “unsuccessful payment” and that’s the only thing which form knows – so if it gets informed that payment didn’t work, it issues the error and cannot allow form submission.
Then there’s error checking – usually form would “expect” errors to be corrected but, unlike with form fields, those can’t quite be corrected on the form directly and PayPal scripts require request with all necessary data to be send to them again – which involves some data being sent to initialize PayPal buttons. And that only happens on form load.
All in all, I think we should consider this a bug but I’m not sure yet if it’s something that could be simply fixed on our end (except from rebuilding PayPal integration entirely) so for now I don’t have a workaround, I’m afraid.
I have already submitted this behavior as a bug to our Forminator Team so developers will look into it and if possible – they’ll include fix with one of future releases but I’m not able to provide ETA yet as they first need to examine it and identify the exact cause, then find a way to override it, and this might take some time, I’m afraid.
Kind regards,
AdamHi @dinnershow
I hope you are doing well and safe!
We haven’t heard from you in a while, I’ll mark this thread as resolved.
Feel free to let us know if you have any additional questions or problems.
Best Regards
Patrick FreitasHello Patrick,
It is not really resolved as in the previous communication Adam could only say, and as quoted:All in all, I think we should consider this a bug but I’m not sure yet if it’s something that could be simply fixed on our end (except from rebuilding PayPal integration entirely) so for now I don’t have a workaround, I’m afraid.
I have already submitted this behavior as a bug to our Forminator Team so developers will look into it and if possible – they’ll include fix with one of future releases but I’m not able to provide ETA yet as they first need to examine it and identify the exact cause, then find a way to override it, and this might take some time, I’m afraid.
So the issue is not really resolved.
Regards
BI am having this same issue. Is there any update on fixing the bug or a workaround to have javascript remove the validation error and allow the form to submit?
I would like to update you regards the current issue, we confirmed it is a bug in the plugin. Unfortunately, the fix requires updating the plugin code but we already reported it to our developers.
We can’t give an estimated time yet for the fix but subscribing to our roadmap https://wpmudev.com/roadmap/ is a good way to be posted about upcoming versions, once they are released, it is going to be described at changelog found on https://www.ads-software.com/plugins/forminator/#developers
Since the bug was acknowledged, reported and tasked to be fixed, we are marking this as resolved, but feel free to let us know if you have any additional questions.
Kind Regards,
KrisI have the same problem. Looking forward to a fix.
- The topic ‘Cannot submit Form if an error is corrected but can submit if no errors are made’ is closed to new replies.