If the checkbox is checked then add value 3 in the original value and if unchecked, minus 3 and keep the original value.
<label>Cost of this report: $ @Session["ProductCost"]</label>
@using (Html.BeginForm("Index", "Home", FormMethod.Post))
{
<div>
@Html.CheckBoxFor(m => m.IsTrainers)
@Html.LabelFor(m => m.IsTrainers, "Include trainers in first Dam")
</div>
<div>
@Html.CheckBoxFor(m => m.IsSales)
@Html.LabelFor(m => m.IsSales, "Include Sales in first Dam")
</div>
<div>
@Html.CheckBoxFor(m => m.IsResearch)
@Html.LabelFor(m => m.IsResearch, "Research Style (all foals inc)")
</div>
<div>
@Html.CheckBoxFor(m => m.IsEngagement)
@Html.LabelFor(m => m.IsEngagement, "Include Race engagements in first Dam")
</div>
}
The model for this checkbox:
public class ClsHome
{
public bool IsTrainers { get; set; }
public bool IsSales { get; set; }
public bool IsResearch { get; set; }
public bool IsEngagement { get; set; }
public bool IsFamilyRunners { get; set; }
}
Anyone please guide me how to do this.Thank you in advance.