title: Submit Button not firing in Razor Forms
body: <p>I am writing a web-app to submit incident forms. I am using the typical <code>@using (Html.BeginForm())</code> and then an input button at the bottom to submit the model. </p>
  
  <p>My code for the view and controller is below.<br>
  My controller is under <code>~/Controllers/FormsController.cs</code><br>
  My view is under <code>~/Views/Forms/Default.cshtml</code></p>
  
  <p>There is a lot of code that is all pretty much the same below, and I was put over my character limit, so I took a lot of it out. </p>
  
  <p>Basically when I hit the "Submit Form" Button at the button, it doesn't go to the action method. Nothing happens. When I replaced it with:</p>
  
  <pre><code>&lt;input type="submit" value="Submit Form" onclick="location.href='@Url.Action("Save", "Forms")'" /&gt;
  </code></pre>
  
  <p>It works, but I wasn't able to find a way to pass my model that way. It just calls the method but the model is null. </p>
  
  <p>So my ultimate question is, why isn't my button working? I get these errors in Developer Tools in Chrome every time I hit the button. So looks like my jquery is messing something up.</p>
  
  <ol>
  <li><strong>An invalid form control with name='MedicationGivenDescription' is not focusable.</strong></li>
  <li><strong>An invalid form control with name='OtherTypeOfTreatmentDescription' is not focusable.</strong></li>
  </ol>
  
  <p><strong>View:</strong></p>
  
  <pre><code>@model YMCA_Incident_Reports.Models.DefaultIncident
  @{
  ViewBag.Title = "Default Incident Form";
  Layout = "~/Views/Shared/_Layout.cshtml";
  }
  &lt;div&gt;
  &lt;h1&gt;YMCA of Burlington and Camden Counties&lt;/h1&gt;
  &lt;p&gt;Check appropriate Boxes&lt;/p&gt;
  &lt;/div&gt;
  @using (Html.BeginForm("Save", "Forms"))
  {
  &lt;div class="table-bordered"&gt;
      &lt;table&gt;
          &lt;thead&gt;
              &lt;tr&gt;
                  ....
              &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tr&gt;
              &lt;td&gt;@Html.CheckBoxFor(model =&gt; model.Accident)&lt;/td&gt;
              &lt;td&gt;@Html.DisplayNameFor(model =&gt; model.Accident)&lt;/td&gt;
              &lt;td&gt;@Html.CheckBoxFor(model =&gt; model.Incident)&lt;/td&gt;
              &lt;td&gt;@Html.DisplayNameFor(model =&gt; model.Incident)&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;@Html.CheckBoxFor(model =&gt; model.MountLaurel)&lt;/td&gt;
              &lt;td&gt;@Html.DisplayNameFor(model =&gt; model.MountLaurel)&lt;/td&gt;
              &lt;td&gt;@Html.CheckBoxFor(model =&gt; model.Riverfront)&lt;/td&gt;
              &lt;td&gt;@Html.DisplayNameFor(model =&gt; model.Riverfront)&lt;/td&gt;
              &lt;td&gt;@Html.CheckBoxFor(model =&gt; model.ChildCare)&lt;/td&gt;
              &lt;td&gt;@Html.DisplayNameFor(model =&gt; model.ChildCare)&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;@Html.CheckBoxFor(model =&gt; model.PrimeTime)&lt;/td&gt;
              &lt;td&gt;@Html.DisplayNameFor(model =&gt; model.PrimeTime)&lt;/td&gt;
              &lt;td&gt;@Html.CheckBoxFor(model =&gt; model.DayCamp)&lt;/td&gt;
              &lt;td&gt;@Html.DisplayNameFor(model =&gt; model.DayCamp)&lt;/td&gt;
              &lt;td&gt;@Html.CheckBoxFor(model =&gt; model.CamdenExpansion)&lt;/td&gt;
              &lt;td&gt;@Html.DisplayNameFor(model =&gt; model.CamdenExpansion)&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
     **More tables with other Html Helpers.**
  
      &lt;input type="submit" class="btn btn-primary" value="Submit Form" /&gt;
  &lt;/div&gt;
  
  }
  </code></pre>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.Mvc;
  using YMCA_Incident_Reports.Models;
  
  namespace YMCA_Incident_Reports.Controllers
  {
  public class FormsController : Controller
  {
      // GET: Forms
      public ActionResult Default()
      {
          DefaultIncident model = new DefaultIncident();
          var now = DateTime.Now;
          model.TimeAndDateOfIncident = now;
          return View(model);
      }
  
      // Post: Forms
  
      public ActionResult Save(DefaultIncident model)
      {
          return View();
      }
  
  }
  }
  </code></pre>
  
  <p><strong>Model:</strong></p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel.DataAnnotations;
  using System.Linq;
  using System.Web;
  using System.Web.Mvc;
  
  namespace YMCA_Incident_Reports.Models
  {
  public class DefaultIncident
  {
      public bool Accident { get; set; }
      public bool Incident { get; set; }
      [Display(Name = "Mt. Laurel")]
      public bool MountLaurel { get; set; }
      public bool Riverfront { get; set; }
      [Display(Name = "Child Care")]
      public bool ChildCare { get; set; }
      [Display(Name = "Prime Time")]
      public bool PrimeTime { get; set; }
      [Display(Name = "Day Camp")]
      public bool DayCamp { get; set; }
      [Display(Name = "Camden Expansion")]
      public bool CamdenExpansion { get; set; }
      public string SiteLocation { get; set; }
      public string Name { get; set; }
  
      [Required(ErrorMessage = "Your must provide a PhoneNumber")]
      [Display(Name = "Home Phone")]
      [DataType(DataType.PhoneNumber)]
      [RegularExpression(@"^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$", ErrorMessage = "Not a valid Phone number")]
      public string PhoneNumber { get; set; }
  
      public string DateOfBirth { get; set; }
      public int? Age { get; set; }
  
      public string Gender { get; set; }
      public string GuardiansName { get; set; }
      public string Address { get; set; }
      public DateTime TimeAndDateOfIncident { get; set; }
      public string IncidentDescription { get; set; }
      public string ResolutionDescription { get;  set;}
  
      //incident types
      public bool Argument { get; set; }
      public bool Language { get; set; }
      public bool Complaint { get; set; }
      [Display(Name = "Rule Enforcment")]
      public bool RuleEnforcment { get; set; }
      public bool Theft { get; set; }
      [Display(Name = "Fight/Bullying")]
      public bool FightOrBullying { get; set; }
      [Display(Name = "Water Resuce")]
      public bool WaterRescue { get; set; }
      [Display(Name = "Innapropriate Behavior/Abuse")]
      public bool InnapropriateBehaviorOrAbuse { get; set; }
  
      //type of injury
      public bool Ache { get; set; }
      public bool Bite { get; set; }
      [Display(Name = "Bitten By Animal")]
      public bool BittenByAnimal { get; set; }
      public bool Bleeding { get; set; }
      [Display(Name = "Breathing Rapidly")]
      public bool BreathingRapidly { get; set; }
      [Display(Name = "Breathing Shallow")]
      public bool BreathingShallow { get; set; }
      [Display(Name = "Broken Bone Suspected")]
      public bool BrokenBoneSuspected { get; set; }
  
      public bool Bruise { get; set; }
      public bool Burn { get; set; }
      public bool Chocking { get; set; }
      public bool Cut { get; set; }
      public bool Drowning { get; set; }
      [Display(Name = "Near Drowning")]
      public bool NearDrowning { get; set; }
      [Display(Name = "Eye Injury")]
      public bool EyeInjury { get; set; }
      [Display(Name = "Foreign Object in Eye")]
      public bool ForeignObjectInEye { get; set; }
  
      [Display(Name = "Head Injury")]
      public bool HeadInjury { get; set; }
      public bool Itching { get; set; }
      [Display(Name = "Nausea/Throw Up")]
      public bool NauseaOrThrowUp { get; set; }
      [Display(Name= "Nose Bleed")]
      public bool NoseBleed { get; set; }
      public bool Poisoning { get; set; }
      public bool Rash { get; set; }
      public bool Redness { get; set; }
  
      public bool Scrape { get; set; }
      public bool Scratch { get; set; }
      public bool Splinter { get; set; }
      public bool Sprain { get; set; }
      public bool Sting { get; set; }
      public bool Swelling { get; set; }
      [Display(Name = "Slip/Fall")]
      public bool SlipOrFall { get; set; }
      [Display(Name="Other (Describe):")]
      public bool OtherTypeOfInjury { get; set; }
      public string OtherTypeOfInjuryDescription { get; set; }
  
      //place on body where it occured
      public bool LeftSide { get; set; }
      public bool RightSide { get; set; }
  
      public bool Abdomen { get; set; }
      public bool Arm { get; set; }
      public bool Ankle { get; set; }
      public bool Back { get; set; }
      public bool Buttocks { get; set; }
      public bool Cheek { get; set; }
      public bool Chest { get; set; }
      public bool Chin { get; set; }
      public bool Ear { get; set; }
      public bool Eye { get; set; }
      public bool Elbow { get; set; }
      public bool Finger { get; set; }
      public bool Foot { get; set; }
      public bool Forehead { get; set; }
      public bool Groin { get; set; }
      public bool Hand { get; set; }
      public bool Head { get; set; }
      public bool Hip { get; set; }
      public bool Knee { get; set; }
      public bool Leg { get; set; }
      public bool Lip { get; set; }
      public bool Mouth { get; set; }
      public bool Neck { get; set; }
      public bool Nose { get; set; }
      public bool Shoulder { get; set; }
      public bool Teeth { get; set; }
      public bool Thigh { get; set; }
      public bool Toe { get; set; }
      public bool Tongue { get; set; }
      public bool Wrist { get; set; }
  
      //Place where incident occured
      public bool Classroom { get; set; }
      public bool Playground { get; set; }
      [Display(Name = "Fitness Center")]
      public bool FitnessCenter { get; set; }
      public bool Bathroom { get; set; }
      [Display(Name = "Weight Room")]
      public bool WeightRoom { get; set; }
      [Display(Name = "Parking Lot")]
      public bool ParkingLot { get; set; }
      [Display(Name = "Adult Locker RM - M")]
      public bool AdultLockerRoomMen { get; set; }
      [Display(Name = "Adult Locker RM - W")]
      public bool AdultLockerRoomWomen { get; set; }
  
      public bool Babysitting { get; set; }
      public bool Kitchen { get; set; }
      [Display(Name="Side Walk")]
      public bool SideWalk { get; set; }
      [Display(Name = "Family Locker RM - M")]
      public bool FamilyLockerRoomMen { get; set; }
      [Display(Name = "Family Locker RM - W")]
      public bool FamilyockerRoomWomen { get; set; }
      public bool Studio { get; set; }
      public bool Hallway { get; set; }
      public bool Bus { get; set; }
      public bool Car { get; set; }
      [Display(Name = "Pool Area")]
      public bool PoolArea { get; set; }
      [Display(Name="Stretch Room")]
      public bool StretchRoom { get; set; }
      public bool Stairway { get; set; }
      public bool Field { get; set; }
      public bool Gym { get; set; }
      public bool Playzone { get; set; }
      [Display(Name = "Other (Describe):")]
      public bool OtherPlace { get; set; }
      public string OtherPlaceDescription { get; set; }
  
      //type of surface
      public bool Carpeting { get; set; }
      public bool Rubber { get; set; }
      [Display(Name = "Tile Floor")]
      public bool TileFloor { get; set; }
      public bool Concrete { get; set; }
      [Display(Name="Wood Floor")]
      public bool WoodFloor { get; set; }
      public bool Asphalt { get; set; }
      [Display(Name="Wood Chips")]
      public bool WoodChips { get; set; }
      public bool Grass { get; set; }
      public bool Sand { get; set; }
      [Display(Name = "Other (Describe):")]
      public bool OtherTypeOfSurface { get; set; }
      public string OtherTypeOfSurfaceDescription { get; set; }
  
  
      //type of treatment given
      [Display(Name = "Cleaned with Soap and Water")]
      public bool CleanedWithSoapAndWater { get; set; }
      [Display(Name = "Antiseptic Applied")]
      public bool AntisepticApplied { get; set; }
      [Display(Name = "Bandage Applied")]
      public bool BandageApplied { get; set; }
      [Display(Name = "Ice Applied")]
      public bool IceApplied { get; set; }
      [Display(Name = "Rest Provided")]
      public bool RestProvided { get; set; }
      [Display(Name = "Removed Splinter")]
      public bool RemovedSplinter { get; set; }
      public bool Consoled { get; set; }
      [Display(Name = "Medication Given")]
      public bool MedicationGiven { get; set; }
      public string MedicationGivenDescription { get; set; }
      [Display(Name = "Other (Describe):")]
      public bool OtherTypeOfTreatment { get; set; }
      public string OtherTypeOfTreatmentDescription { get; set; }
  
      //where treatment was given
      [Display(Name = "At the center")]
      public bool TreatmentAtTheCenter { get; set; }
      [Display(Name = "Clinic/Doctor's Office")]
      public bool TreatmentAtClinicOrDoctorsOffice { get; set; }
      [Display(Name = "Emergency Room")]
      public bool TreatmentAtEmergencyRoom { get; set; }
  
      //follow-up actions
      [Display(Name="Parent/Emergency Contact Notified")]
      public bool ParentOrEmergencyContactNotified { get; set; }
      [Display(Name = "Date")]
      public string DateParentOrEmergencyContactNotified { get; set; }
      [Display(Name = "Time")]
      public string TimeParentOrEmergencyContactNotified { get; set; }
      [Display(Name = "Ambulance Called")]
      public bool AmbulanceCalled { get; set; }
      [Display(Name = "Poinson Control/Physician Called")]
      public bool PoisonControlOrPhysicianCalled { get; set; }
      [Display(Name = "Remained At Center")]
      public bool RemainedAtCenter { get; set; }
      [Display(Name = "Picked Up By Guardian/Drove Home")]
      public bool PickedUpByGuardianOrDroveHome { get; set; }
      [Display(Name = "Taken By Center Staff For Emergency Treatment")]
      public bool TakenByCenterStaffForEmergencyTreatment { get; set; }
      [Display(Name="Name Of Emergency Care Facility:")]
      public string NameOfEmergencyCareFacility { get; set; }
      [Display(Name="Condition Of Injury Upon Return To Center:")]
      public string ConditionOfInjuryUponReturnToCenter { get; set; }
  
      //witnesses
      [Display(Name="Staff Supervising Program/Area")]
      public string StaffSupervisingProgramOrArea { get; set; }
      [Display(Name = "Staff Who Performed First Aid")]
      public string StaffWhoPerformedFirstAid { get; set; }
      [Display(Name = "Person(s) who witnessed the accident")]
      public string WitnessesToAccident { get; set; }
  
      //signatures
      [Display(Name = "Staff Signature")]
      public string StaffSignature { get; set; }
      [Display(Name = "Staff Signature Date")]
      public string StaffSignedDate { get; set; }
      [Display(Name = "Parent Signature")]
      public string ParentSignature { get; set; }
      [Display(Name = "Parent Signature Date")]
      public string ParentSignatureDate { get; set; }
      [Display(Name = "Director Signature")]
      public string DirectorSignature { get; set; }
      [Display(Name = "Director Signature Date")]
      public string DirectorSignatureDate { get; set; }
  
  }
  }
  </code></pre>