What are the complete set of Steps Required for client-side unobtrusive validation to work for dynamically inserted form fields?
Relevant SO posts
ASP.NET MVC 3 unobtrusive client-side validation with dynamic content – He needed the unobtrusive validation attributes to show up in the generated HTML and did so by calling BeginForm
ASP.Net MVC 3 validation on AjaxForm – The asker was using Ajax.BeginForm which uses MicrosoftAjax instead of JQuery.validation.
PartialView and unobtrusive client validation not working – He had the problem with unobtrusive validation attributes not showing up and overrode ViewContext.FormContext as a workaround.
ASP.NET MVC 3: Generate unobtrusive validation when BeginForm is on the layout – Workaround for unobtrusive validation attributes not showing up in HTML
Relevant Links
Brad Wilson’s Unobtrusive Client Validation in ASP.NET MVC 3
The Complete Guide To Validation In ASP.NET MVC 3 – Part 1
The Complete Guide To Validation In ASP.NET MVC 3 – Part 2
Unobtrusive Client-side Validation with Dynamic Contents in ASP.NET MVC 3
At this point I believe the following is a complete set of requirements:
Html.BeginFormClientValidationEnabledUnobtrusiveJavaScriptEnabledHtml.BeginFormcall, use a relevant workaround (see workaround 1 and workaround 2)jquery,jquery.validate.js, andjquery.validate.unobtrusive.jsfiles, in that orderjQuery.validator.unobtrusive.adaptersjQuery.validator.addMethod.$(document).ready()as at that point it’s too latejQuery.validator.unobtrusive.parseorjQuery.validator.unobtrusive.parseElementon elements added dynamically after the initial page load.