Validation of fields in cshtml [closed]

1

I have seen some examples to validate fields, but all of them I have to tell you which field or control to be validated, ie I have to pass the controls name. If I have a form with 20 fields, that "language" is left. How do I do at one time, validate the various types of controls I have in my form such as Inputs, Options and etc? It can be via javascript, jquery and etc ....

Use MVC 5 and this validation is in my CSHTML.

    
asked by anonymous 17.03.2014 / 16:37

1 answer

1

These fields can be validated through data annotations as in this example I did in my blog , or by using jQuery validation as in this example (in jQuery validation the attributes that will be passed to the method must have the same name of the HTML element).

    
17.03.2014 / 16:44