Showing 1 – 2 of 2 replies
dxfiles09

I have bought the Flacto template and […]

dxfiles09 PURCHASED
6 years ago
Hello @coderthemes. I have bought the Flacto template and I'm currently using it on a personal project. I'm using ASP .NET Core with MVC. By default MVC manages the use of jquery-validation so by default I always have my forms validated. But with Flacto, whenever I hit a submit button, after the POST the view is reloaded, so I'm getting the error messages for each validated input (in a span below) but then message is replaced by one saying: "The value "" is invalid". I will need to know where are do you guys handle the forms validation to comment that code and leave my default MVC validations with jquery-unobstrusive... Also, if I write an script to validate specific fields by myself on the same page, the validation error messages are also "deleted" when the page reloads after the submit action. So all the validation messages are being overwritten by the Flacto designed behavior. I'll be waiting for your answer. Thanks in advance. You can also reply to my email address: dpadron.alvarez(at)gmail.com
Coderthemes
Coderthemes SELLER
6 years ago
Hi,

Are you filling out error messages from your backend? I meant from your ASP code?

It's easy to remove validation from js side if you are already doing it inside MVC code.

Please let me know if you are having any question.

Thank you
dxfiles09
dxfiles09 PURCHASED
6 years ago
Yes, looking more into it last night I found that I wasn't using the "parsleyjs" flacto uses for client side validation. I include it but it doesn't solved the problem. In theory, when I click the submit button in a form, client side validation is triggered (jquery-validation and unobstrusive) and it must no allow the form to be posted in case of any validation errors. I'm getting those client side validation errors, and now they have a better look using parsley, but the form is being posted anyway, so the server validation is also occurring, resulting in the page being reloaded loosing all the validation messages and leaving only the "The value "" is invalid" below all the validated inputs. Said that, I see that the error is coming from the backend after validating the model on the server-side validation. So I will need to find out who is letting the page to be posted even when there are validation errors. Best Regards