title: validate age according to date of birth using model in mvc 4
body: <p>I have registration form and its  contain date of birth field.</p>
  
  <p>Using calender date picker  its input the value to this field. </p>
  
  <p>these are the steps to insert value for this field </p>
  
  <p>step 1</p>
  
  <p><img src="https://i.stack.imgur.com/Me7Ji.png" alt="enter image description here"></p>
  
  <p>step 2 </p>
  
  <p><img src="https://i.stack.imgur.com/9XUbs.png" alt="enter image description here"></p>
  
  <p>step 3</p>
  
  <p><img src="https://i.stack.imgur.com/EYzuR.png" alt="enter image description here"></p>
  
  <p>so its taking values in <strong>dd/MM/yyyy</strong> format</p>
  
  <p>This is appearance of <strong>date of birth</strong> field in my <strong>model class</strong></p>
  
  <pre><code>[DisplayName("Date of Birth")]
  [DataType(DataType.Date), DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
  public Nullable&lt;System.DateTime&gt; Date_of_Birth { get; set; }
  </code></pre>
  
  <p>This is appearance of <strong>date of birth</strong> field in my <strong>view file</strong></p>
  
  <pre><code>   &lt;div class="form-group"&gt; 
     &lt;div class="editor-label"&gt;
          @Html.LabelFor(model =&gt; model.Date_of_Birth)
          @Html.Label("*", new { id="star" , @class = "requiredFiledCol" })
     &lt;/div&gt;
     &lt;div class="editor-field"&gt;
          @Html.TextBoxFor(model =&gt; model.Date_of_Birth, "{0:dd/MM/yyyy}", new { @class = "form-control datepicker", placeholder = "DD/MM/YYYY" , maxlength="100" })
          @Html.ValidationMessageFor(model =&gt; model.Date_of_Birth)
      &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>I want to do client side validation for data of birth field . show error message when input filed is not in this range <strong>100>Age>18</strong></p>
  
  <p>whats the approach I should take ?</p>