title: How to compare two values in MVC validation?
body: <p>I am creating an application where I am having Age range, weight range, height range and etc. So in these fields I am using two text boxes for each. For example for Age range I am using Age From and Age To these two textboxes and so on for the other properties. But I am trying to find a solution to compare the Age From and Age To to check whether the Age To is not getting bigger than the Age From and vice versa. To achieve this I have downloaded Foolproof from NUGET and doing like this:</p>
  
  <pre><code>    [GreaterThan("WeightFrom",ErrorMessage="Please verify the Weight Range")]
      public string WeightTo { get; set; }
  </code></pre>
  
  <p>But this Validator checks for the field as a required field whether it is not. Because it is possible that user may not fill this criteria at all but if they fill then I need to check the input to ensure that the Weight To is greater than the Weight From value. So, please advise me how do I achieve this.Is there any other way of doing this? Thanks.</p>