title: ASP.NET razor: Form not submitting
body: <p>Since I added a DisplayFormat and datepicker to my DateTime properties/inputfields, my form stopped submitting. I don't get any errors (In chrome F12 or Visual studio).</p>
  
  <p>Edit: I've set Displayformat to dd/MM/yyyy and the datepicker to "dd/mm/yyyy". But that didn't solve it either.</p>
  
  <pre><code>@using (Html.BeginForm("CreateCampaign", "Home")) {
      @Html.ValidationSummary(true)
      &lt;fieldset&gt;
          &lt;legend&gt;Campaign&lt;/legend&gt;
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.Campaign.CampaignName)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.EditorFor(model =&gt; model.Campaign.CampaignName)
              @Html.ValidationMessageFor(model =&gt; model.Campaign.CampaignName)
          &lt;/div&gt;
  
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.Campaign.WebsiteUrl)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.EditorFor(model =&gt; model.Campaign.WebsiteUrl)
              @Html.ValidationMessageFor(model =&gt; model.Campaign.WebsiteUrl)
          &lt;/div&gt;
  
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.Campaign.PrivacyPolicyUrl)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.EditorFor(model =&gt; model.Campaign.PrivacyPolicyUrl)
              @Html.ValidationMessageFor(model =&gt; model.Campaign.PrivacyPolicyUrl)
          &lt;/div&gt;
  
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.Campaign.TermsUrl)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.EditorFor(model =&gt; model.Campaign.TermsUrl)
              @Html.ValidationMessageFor(model =&gt; model.Campaign.TermsUrl)
          &lt;/div&gt;
  
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.Campaign.PricepageUrl)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.EditorFor(model =&gt; model.Campaign.PricepageUrl)
              @Html.ValidationMessageFor(model =&gt; model.Campaign.PricepageUrl)
          &lt;/div&gt;
  
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.Campaign.Startdate)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.EditorFor(model =&gt; model.Campaign.Startdate)
              @Html.ValidationMessageFor(model =&gt; model.Campaign.Startdate)
          &lt;/div&gt;
  
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.Campaign.Enddate)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.EditorFor(model =&gt; model.Campaign.Enddate)
              @Html.ValidationMessageFor(model =&gt; model.Campaign.Enddate)
          &lt;/div&gt;
  
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.Campaign.Starthour)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.DropDownListFor(model =&gt; model.Campaign.Starthour, new SelectList(Model.Hours))
              @Html.ValidationMessageFor(model =&gt; model.Campaign.Starthour)
          &lt;/div&gt;
  
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.Campaign.Endhour)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.DropDownListFor(model =&gt; model.Campaign.Endhour, new SelectList(Model.Hours))
              @Html.ValidationMessageFor(model =&gt; model.Campaign.Endhour)
          &lt;/div&gt;
  
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.Campaign.PMAM)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.DropDownListFor(model =&gt; model.Campaign.PMAM, new SelectList(Model.AMPM, "key", "value"))
              @Html.ValidationMessageFor(model =&gt; model.Campaign.PMAM)
          &lt;/div&gt;
  
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.Campaign.Language)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.DropDownListFor(model =&gt; model.Campaign.Language, new SelectList(Model.Languages, "key", "value"))
              @Html.ValidationMessageFor(model =&gt; model.Campaign.Language)
          &lt;/div&gt;
  
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.Campaign.FK_ID_MerchantApp)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.EditorFor(model =&gt; model.Campaign.FK_ID_MerchantApp)
              @Html.ValidationMessageFor(model =&gt; model.Campaign.FK_ID_MerchantApp)
          &lt;/div&gt;
  
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.Campaign.CampaignType)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.DropDownListFor(model =&gt; model.Campaign.CampaignType, new SelectList(Model.Types, "key", "value"))
              @Html.ValidationMessageFor(model =&gt; model.Campaign.CampaignType)
          &lt;/div&gt;
          &lt;p&gt;
              &lt;input type="submit" value="Create" /&gt;
          &lt;/p&gt;
      &lt;/fieldset&gt;
  }
  &lt;script type="text/javascript"&gt;
      $('#Campaign_Startdate').datepicker({
          dateFormat: "DD, d MM, yy",
          minDate: new Date()
      });
      $('#Campaign_Enddate').datepicker({
          dateFormat: "DD, d MM, yy",
          minDate: new Date()
      });
  
  &lt;/script&gt;
  &lt;div&gt;
      @Html.ActionLink("Back to List", "Index")
  &lt;/div&gt;
  
  
  
  
         public class Campaign
          {
              #region CTor
              public Campaign()
              {
              }
              #endregion
  
              #region Properties
  
              [XmlElement(ElementName = "Id_campaign")]
              public string ID_Campaign { get; set; }
              [XmlElement(ElementName = "Campaignname")]
              public string CampaignName { get; set; }
              [XmlElement(ElementName = "Websiteurl")]
              public string WebsiteUrl { get; set; }
              [XmlElement(ElementName = "Privacypolicyurl")]
              public string PrivacyPolicyUrl { get; set; }
              [XmlElement(ElementName = "Termsurl")]
              public string TermsUrl { get; set; }
              [XmlElement(ElementName = "Pricepageurl")]
              public string PricepageUrl { get; set; }
              [XmlElement(ElementName = "Maxcredit")]
              public Int32 MaxCredit { get; set; }
              [XmlElement(ElementName = "Fk_id_currency")]
              public string FK_ID_Currency { get; set; }
              [XmlElement(ElementName = "Maxscans")]
              public short MaxScans { get; set; }
              [XmlElement(ElementName = "Startdate")]
              [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:ddd, MMM d, yyyy}")]
              public DateTime Startdate { get; set; }
              [XmlElement(ElementName = "Enddate")]
              [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:ddd, MMM d, yyyy}")]
              public DateTime Enddate { get; set; }
              [XmlElement(ElementName = "Starthour")]
              public short Starthour { get; set; }
              [XmlElement(ElementName = "Endhour")]
              public short Endhour { get; set; }
              [XmlElement(ElementName = "Pmam")]
              public string PMAM { get; set; }
              [XmlElement(ElementName = "Language")]
              public string Language { get; set; }
              [XmlElement(ElementName = "Fk_id_merchantapp")]
              public string FK_ID_MerchantApp { get; set; }
              [XmlElement(ElementName = "Campaigntype")]
              public string CampaignType { get; set; }
              [XmlElement(ElementName = "Createtimestamp")]
              [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:ddd, MMM d, yyyy}")]
              public DateTime CreateTimestamp { get; set; }
              [XmlElement(ElementName = "Lastupdate")]
              [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:ddd, MMM d, yyyy}")]
              public DateTime LastUpdate { get; set; }
              [XmlElement(ElementName = "Lastupdateby")]
              public string LastUpdateBy { get; set; }
              [XmlElement(ElementName = "Status")]
              public short Status { get; set; }
      }
  </code></pre>