Hi,
I'm facing an issue with FormValidation plugin that is solved in one of their updates. However the version used by KeenThemes plugin.bundle is an old version from 2020 (v1.10) of formvalidation.
Is it possible to update ou replace the version used in plugin bundle by the latest version of of FV?
Hi,
Yes, we are going to update to the latest FormValidation v2.4.0 in the next Metronic v8.1.9 update in a few days.
May I know which theme are you using?
Regards.
Thank you for the prompt reply.
I compared the formvalidation versions again and the issue I'm facing is described in update 1.6 of formvalidation as "The SubmitButton plugin doesn't send the clicked button to server". This is exactly the issue I'm facing.
If I'm correct, KT is already using the version 1.10, so the issue is supposed to be fixed even thought I can't detect the button clicked.
I read the whole formvalidation documentation but the issue keeps happening. When I remove the SubmitButton plugin from the code it works just fine.
This is my formvalidation code (pretty std).
...
plugins: {
trigger: new FormValidation.plugins.Trigger(),
submitButton: new FormValidation.plugins.SubmitButton(),
defaultSubmit: new FormValidation.plugins.DefaultSubmit(),
bootstrap: new FormValidation.plugins.Bootstrap5({
rowSelector: ".fv-row",
eleInvalidClass: "",
eleValidClass: ""
})
}
<button type="submit" name="btnAdd" value="add" class="btn btn-info mt-5 ps-7 py-4 me-3">Add and Save</button>
<button type="submit" name="btnLayout" value="layout" class="btn btn-info mt-5 ps-7 py-4 me-3">Save and exit</button>
Hi,
Please note that Metronic currently uses FormValidation 2.2.x version.
This might be caused when e.preventDefault() is called on the form's submit event. Do you have such code ?
Also can you try to submit your form without using FormValidation plugin to verify if you will be able to capture the submit form name in your PHP code.
Regards.
Hi Sean,
I'm still struggling with form validation issues. You mentioned previously that Metronic is using version 2.2.x, but take a look at the screenshot below where the form validation plugin file indicates version v1.10.0 (2236098).
https://share.cleanshot.com/RDgpscFC
I'm using this Metronic theme:
https://preview.keenthemes.com/metronic8/demo25/index.html?mode=light&_ga=2.51819369.1930575035.1688347918-1973985247.1665507314
To answer your questions, I'm not using e.preventDefault() or any other code, just the default form validation. The problem seems to stem from the plugin line:
plugins: {
...
submitButton: new FormValidation.plugins.SubmitButton()
...
THE PROBLEM:
I have a submit button like this:
<button type="submit" name="btnSave" value="save">
When I try to get the value of the button via PHP like this:
$btnClicked = $_POST['btnSave'];
It returns an empty result, which seems to be due to a bug in FormValidation.
Hi,
Can you try to download the latest Metronic v8.1.9 version you will get FormValidation 2.4.0?
You can check the version in the v8.1.9 source code src/plugins/@form-validation/esm/core/index.min.js
and also in our preview's plugins bundle js as well.
Can you try it with the latest FormValidation 2.4.0 with Metronic 8.1.9 ?
In the meantime, We will contact the plugin author and report this issue for any case.
Regards.
Thank you Sean,
I just downloaded the v8.1.9 and replaced the asset folder...I'm now conducting some tests and will let you know. Thank you once again for the help.
Hi,
Sure thing. Please note that we will release the v8.2.0 update tomorrow with the KeenIcons bug fix for Mac Safari. You can get the new version and just replace the src folder contents.
Regards.