title: Uncaught SyntaxError: Unexpected token u in JSON at position 0 when I call $(form).valid()
body: <p>I have a form like this:</p>
  
  <pre><code>&lt;div class="row"&gt;
      @using (Ajax.BeginForm("ImportFromExcel", "QuanLySim", null, new AjaxOptions
                      {
                          UpdateTargetId = "div-form-daily",
                          HttpMethod = "POST",
                          OnBegin = "QuanLyDaiLy.BeforeSend",
                          OnFailure = "QuanLyDaiLy.Error",
                          OnComplete = "QuanLyDaiLy.Success",
                          InsertionMode = InsertionMode.Replace
                      }, new { @class = "form-update", @role = "form", @id = "search-form" }))
      {
          &lt;div class="col-xs-12 col-sm-12 col-md-12"&gt;
              &lt;div class="col-xs-12 col-sm-12 col-md-12"&gt;
                  &lt;div class="form-group"&gt;
                      &lt;label for="so-ct" class="col-xs-12 col-sm-12 col-md-2 input-sm"&gt;File excel &lt;span class="text-red required"&gt;*&lt;/span&gt;&lt;/label&gt;
                      &lt;div class="col-xs-12 col-sm-12 col-md-10 input-sm"&gt;
                          @Html.TextBoxFor(model =&gt; model.File, new { type = "file", accept = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel", @class = "btn btn-default btn-sm", style = "width: 100%;" })
                      &lt;/div&gt;
                      &lt;div class="col-xs-12 col-sm-12 col-md-2"&gt;&lt;/div&gt;
                      &lt;div class="col-xs-12 col-sm-12 col-md-10 color-red" style="padding-left: 10px; margin-top: 10px"&gt;
                          @Html.ValidationMessageFor(model =&gt; model.File)
                      &lt;/div&gt;
                      &lt;div class="clear"&gt;&lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="col-xs-12 col-sm-12 col-md-12"&gt;
                  &lt;div class="form-group"&gt;
                      &lt;label for="so-ct" class="col-xs-12 col-sm-12 col-md-2 input-sm"&gt;Giá nhân thêm&lt;/label&gt;
                      &lt;div class="col-xs-12 col-sm-12 col-md-10 input-sm"&gt;
                          @Html.TextBoxFor(model =&gt; model.Rate, new { @class = "form-control input-sm", placeholder = "Nhập tỷ giá cho giá sim..." })
                      &lt;/div&gt;
                      &lt;div class="col-xs-12 col-sm-12 col-md-2"&gt;&lt;/div&gt;
                      &lt;div class="col-xs-12 col-sm-12 col-md-10 color-red" style="padding-left: 10px; margin-top: 10px"&gt;
                          @Html.ValidationMessageFor(model =&gt; model.Rate)
                      &lt;/div&gt;                     
  
                  &lt;/div&gt;
              &lt;/div&gt;
  
              &lt;div class="col-xs-12 col-sm-12 col-md-12"&gt;
                  &lt;div class="form-group"&gt;
                      &lt;label for="so-ct" class="col-xs-12 col-sm-12 col-md-2 input-sm"&gt;Chọn đại lý &lt;span class="text-red required"&gt;*&lt;/span&gt;&lt;/label&gt;
                      &lt;div class="col-xs-12 col-sm-12 col-md-10 input-sm"&gt;
                          @Html.DropDownListFor(model =&gt; model.AgentId, (IEnumerable&lt;SelectListItem&gt;)ViewBag.Agents, "Chọn...", new { @class = "form-control input-sm add-daily-sim filter-select" })
                      &lt;/div&gt;
                      &lt;div class="col-xs-12 col-sm-12 col-md-2"&gt;&lt;/div&gt;
                      &lt;div class="col-xs-12 col-sm-12 col-md-10 color-red" style="padding-left: 10px; margin-top: 10px"&gt;
                          @Html.ValidationMessageFor(model =&gt; model.AgentId)
                      &lt;/div&gt;
                      &lt;div class="clear"&gt;&lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="col-xs-12 col-sm-12 col-md-12"&gt;
                  &lt;div class="form-group"&gt;
                      &lt;label for="so-ct" class="col-xs-12 col-sm-12 col-md-2 "&gt;Đảm bảo đã đúng giá?&lt;/label&gt;
                      &lt;div class="col-xs-12 col-sm-12 col-md-1"&gt;
                          @Html.CheckBoxFor(model =&gt; model.IsSure.HasValue)
                      &lt;/div&gt;
                      &lt;label for="so-ct" class="col-xs-12 col-sm-12 col-md-2 "&gt;Xóa sim đại lý&lt;/label&gt;
                      &lt;div class="col-xs-12 col-sm-12 col-md-1 "&gt;
                          @Html.CheckBoxFor(model =&gt; model.IsXoaSimCu.HasValue)
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
  
              &lt;div class="col-xs-12 col-sm-12 col-md-12 text-center"&gt;
                  &lt;div class="form-group"&gt;
                      &lt;button type="button" class="btn bg-maroon btn-cons btn-sm" id="btn-import-excel"&gt;
                          &lt;i class="fa fa-floppy-o fa-lg"&gt;&lt;/i&gt;&amp;nbsp; Lưu
                      &lt;/button&gt;
                      &lt;button class="btn btn-default btn-sm" type="button" onclick="location.href='@Url.Action("Index", "QuanLySim")'"&gt;&lt;i class="glyphicon glyphicon-refresh fa-lg"&gt;&lt;/i&gt;&amp;nbsp; Quay về&lt;/button&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      }
  &lt;/div&gt;
  </code></pre>
  
  <p>And i call jquery to validate form:</p>
  
  <pre><code> if (!$(form).valid()) return;
  </code></pre>
  
  <p>But function form.valid() is error and return message in console like this :
  VM40309:1 Uncaught SyntaxError: Unexpected token u in JSON at position 0</p>
  
  <p>Everybody can help me the problem?</p>
  
  <p>Thanks all</p>