title: Access public virtual dropdown value
body: <p>I have a dropdown list and a datefield. If there is one specific value selected from the dropdown, the datefield should be required.
  To solve that, I tried to use the requiredIf sttribute from the FoolProof library.</p>
  
  <p>But I don't know how to access the selected value in the Model.</p>
  
  <p><strong>Model</strong></p>
  
  <pre><code>//This is the datefield
  [RequiredIf(tabState == "discarded")]
  [DataType(DataType.Date)]
  [Display(Name = "date discarded")]
  public Nullable&lt;System.DateTime&gt; datDiscarded { get; set; }
  
  //This is the dropdown
  public virtual tabState tabState { get; set; }
  </code></pre>
  
  <p><strong>tabState in Controller</strong></p>
  
  <pre><code>ViewBag.intIdeaStateID = new SelectList(db.tabState, "intStateID", "strState");
  </code></pre>
  
  <p><strong>dropdown in View</strong></p>
  
  <pre><code>&lt;div class="form-group"&gt;
      @Html.LabelFor(model =&gt; model.intIdeaStateID, "State", htmlAttributes: new { @class = "control-label col-md-2" })
      &lt;div class="col-md-10"&gt;
          @Html.DropDownList("intIdeaStateID", null, htmlAttributes: new { @class = "form-control" })
          @Html.ValidationMessageFor(model =&gt; model.intIdeaStateID, "", new { @class = "text-danger" })
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>How can I check if the selected value from the dropdown is "discarded"?</p>
  
  <p>Thanks for your help.</p>