{"id":2511,"date":"2022-08-30T15:25:28","date_gmt":"2022-08-30T15:25:28","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/01\/27\/dynamic-data-validation-in-asp-net-mvc-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:25:28","modified_gmt":"2022-08-30T15:25:28","slug":"dynamic-data-validation-in-asp-net-mvc-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/dynamic-data-validation-in-asp-net-mvc-collection-of-common-programming-errors\/","title":{"rendered":"Dynamic data validation in ASP.NET MVC-Collection of common programming errors"},"content":{"rendered":"<p>Have you looked at the jquery validation plugin? One of the options you have there is to declare your UI validation in Javascript. For example for my contact page I have the following validation being used.<\/p>\n<pre><code>$(document).ready(function () {\n    $(\"#ContactForm\").validate({\n        rules: {\n            Name: \"required\",\n            Email: {\n                required: true,\n                email: true\n            },\n            Subject: \"required\",\n            Message: \"required\"\n        }\n    });\n});\n<\/code><\/pre>\n<p>This is a very baisc usage of the plugin.<\/p>\n<p>Obviously you will still need some sort of backend validation, but for you UI this sounds ideal to your scenario.<\/p>\n<p id=\"rop\"><small>Originally posted 2014-01-27 08:42:53. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>Have you looked at the jquery validation plugin? One of the options you have there is to declare your UI validation in Javascript. For example for my contact page I have the following validation being used. $(document).ready(function () { $(&#8220;#ContactForm&#8221;).validate({ rules: { Name: &#8220;required&#8221;, Email: { required: true, email: true }, Subject: &#8220;required&#8221;, Message: &#8220;required&#8221; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2511","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2511","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=2511"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2511\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2511"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2511"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2511"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}