The unobtrusive validation done according to your (correct) understanding is kind of "lazy" in that it only fires when you submit the form. The javascript code referenced by the blog post you linked to simply causes the validation to fire each time you tab out of a control. You're right that it's not really unobtrusive javascript as presented.
I think the way you could make it be unobtrusive is either to add data- attributes to each control (a pain) and write code to inject the script, or to add his little bit of script to one of the main javascript files you are referencing, which is probably his intention.
There is a cool bit about this in chapter 8 of this book: Wrox Professional ASP.NET MVC 3
the ASP.NET MVC site is a decent tutorial to get started with (MVC Music store) as it shows the basics but I can suggest the following books as well:
Professional ASP.NET MVC3
Pro ASP.NET Framework MVC3
I think it's important to point out here that the tutorials are a good starting point - they will not make you an expert. It will be through external reading and practice that MVC will feel "easy" to you. Remember though, there are other books, these are just 2 from the ones I know and have read
The unobtrusive validation done according to your (correct) understanding is kind of "lazy" in that it only fires when you submit the form. The javascript code referenced by the blog post you linked to simply causes the validation to fire each time you tab out of a control. You're right that it's not really unobtrusive javascript as presented.
I think the way you could make it be unobtrusive is either to add
data-
attributes to each control (a pain) and write code to inject the script, or to add his little bit of script to one of the main javascript files you are referencing, which is probably his intention.There is a cool bit about this in chapter 8 of this book: Wrox Professional ASP.NET MVC 3
These two books are GREAT for asp.net mvc 3. I highly recommend them and have both of them.
Professional ASP.NET MVC 3
http://www.magazines.com/product/pro-asp-net-mvc-3-framework?affiliate_id=3823&gclid=CJiU_vn6m68CFYYHRQodyz6RbA
Pro ASP.NET MVC 3 Framework
http://www.amazon.com/dp/1118076583/ref=asc_df_11180765831963163?smid=ATVPDKIKX0DER&tag=hyprod-20&linkCode=asn&creative=395093&creativeASIN=1118076583&hvpos=none&hvexid=&hvnetw=g&hvrand=705138720951824289&hvpone=&hvptwo=&hvqmt=
the ASP.NET MVC site is a decent tutorial to get started with (MVC Music store) as it shows the basics but I can suggest the following books as well:
Professional ASP.NET MVC3
Pro ASP.NET Framework MVC3
I think it's important to point out here that the tutorials are a good starting point - they will not make you an expert. It will be through external reading and practice that MVC will feel "easy" to you. Remember though, there are other books, these are just 2 from the ones I know and have read