nop commerce validation issue

31 views Asked by At

Title: Understanding and Fixing Client-Side Validation in NopCommerce

Question: I'm currently working with nopCommerce, and I've encountered an issue where client-side validation seems to work for some fields without posting the form data. My server-side validation is functioning correctly, but I want to better understand how client-side validation is implemented in nopCommerce and how to resolve this issue.

  1. Can someone explain how nopCommerce performs client-side validation for fields? Is it using jQuery or another method, and where can I find the relevant code?

  2. What steps should I take to ensure that client-side validation works as expected for all fields, just like it does for server-side validation?

  3. I have also added validation attributes to the entity, but it seems these validations are checked in the controller. Is this the intended behavior, or should they also be validated on the client side?

Any insights and guidance on how to troubleshoot and fix this client-side validation issue in nopCommerce would be greatly appreciated. Thank you!

1

There are 1 answers

0
Sadikul Haque Sadi On

If you are working with new cshtml files, you can implement client-side validation independently, without even knowing how nop commerce implements it.

using JS/Jquery will do your job.

Also you can check how nop commerce implemented client-side validation for login fields in this file -

Presentation/Nop.Web/Views/Customer/Login.cshtml