1

I have a view with a dropdown and a Rich Textbox. This view is associated with a model. I would like to make Rich Textbox field is required based on the value selected in dropdownlist.

is there any out of the box feature available in MVC3 to do this?

agnikhil82
  • 25
  • 1
  • 6
  • possible duplicate of [Model Validation / ASP.NET MVC 3 - Conditional Required Attribute](http://stackoverflow.com/questions/8242847/model-validation-asp-net-mvc-3-conditional-required-attribute) – Jan Nov 27 '12 at 10:21

1 Answers1

1

I have had similar requirements in the past, I solved them using FoolProof. It provides extra validation objects such as requiredIf etc.

Only issue I have had is with the JS file, it can be a bit buggy around dates and date handling, other than that, it is ace.

Foolproof site

Nick
  • 6,366
  • 5
  • 43
  • 62
Slicksim
  • 7,054
  • 28
  • 32
  • I've also used Foolproof. Works like a charm. Issues with dates can be solved by using globalize.js, but that requires changes in code. https://github.com/jquery/globalize – kubal5003 Nov 28 '12 at 10:40