title: Required Field Validation in ASP MVC using Kendo UI
body: <p>I have a textbox and want to display the field is required when the form gets submitted. The error message do appear in case i click on the textbox and tab to go to next textbox. I have the 'Required' data annotation on my model like this:</p>
  
  <pre><code>[DisplayName("Shipment Number")]
  [Required]
  public string ShipmentNumber          { get; set; }
  </code></pre>
  
  <p>My View looks like this:</p>
  
  <pre><code>&lt;div class="col-sm-8"&gt;
      @Html.TextBoxFor(model =&gt; model.ShipmentNumber, new {@class = "form-control", @maxlength = "8", @title = "Maximum length is 8"})
      @Html.ValidationMessageFor(model =&gt; model.ShipmentNumber)
  &lt;/div&gt;
  </code></pre>
  
  <p>Oh, i also added these in $function:</p>
  
  <pre><code>$("form").kendoValidator();
  
  $.validator.setDefaults({
         ignore: ""
   });
  </code></pre>
  
  <p>When i leave the textbox blank and submit the form, the form gets submitted without showing the error message i.e. 'The Shipment Number is required!'.
  P.S: I also tried DataAnnotation: </p>
  
  <pre><code>[Required(ErrorMessage = "ShipmentNumber Is Required")]
  </code></pre>
  
  <p>Does anyone know how i can achieve this?</p>
  
  <p><strong>Update:</strong>
  This fixed it:
  Changes in Razor code to make textbox required and added required error message.</p>
  
  <pre><code>@Html.TextBoxFor(model =&gt; model.ShipmentNumber, new {@class = "form-control", @maxlength = "8", @title = "Maximum length is 8", data_required_msg = "Shipment Number is required!", required = "required" })
  </code></pre>
  
  <p>In button submit code in javascript, did this:</p>
  
  <pre><code>var validator = $(".form-horizontal").kendoValidator().data("kendoValidator");
  if (validator.validate()) {
    //code that needs to be executed if it is valid
  }
  </code></pre>
  
  <p>Note: I also got rid of data annotation from modal class, @Html.ValidationMessageFor and $("form").kendoValidator code.</p>