I'm a long time Windows Form developer, trying to get my mind around how to do web development. As the title says, I'm pretty sure I want to move forward with ASP.NET MVC. I'm also pretty sure the answer is going to lie somewhere in the realm of Javascript, jQuery (and jQueryUI), none of which I've had a chance to learn yet.
In our current windows app, we have forms that use tab controls, where each tab control has tons of controls for data entry. So, below are the types of issues I need to be able to do (at the client side)
- conditionally require for example that one or more of a subset of controls on a form be required. So for example, because a certain value is selected in a dropdown box, trigger the above rule where one or more controls must be entered... or 1 and only 1 of a subset be conditionally required. Additionally, the subset of conditional required controls can be of different types.
I could go on and on about this but i doubt additional examples will change the answer.
So for clarity, I don't need something like what a think I can do with mvc data annotations, where I can use an attribute to mark a specific field as required, or within a certain range. I need that type of validation buried inside a bunch of other validation.
So, is there a best practice solution for this sort of complex client side validation? Is there some 3rd party Javascript library that might allow this?
In my Windows app, I've been able to write little wrapper rules that all derive from a common base class. So for example, i have a rule with a method to addChilren for example, that all allows you to add either other objects derived from the base class rule, or just other controls, and this rule can be updated at run time to require 1 or more of the children objects...
And then of course this rule "RequireOneOrMore" can then be reused in other places and even be passed as a child to other Rules...
I hope some of this makes sense....
So, while I work through my mvc book towards my Javascript book can anyone suggest what options I might research to accomplish this?
Thanks, jonathan