これら 2 つの textboxfor があり、小数点以下 2 桁までしか入力できないようにする必要があります。私は、jQuery または Javascript イベントがこれを行うことができると仮定しています。Javascript で textboxfor を呼び出す方法がわかりません。どんな助けでもいただければ幸いです
@Html.TextBoxFor(m => Model.Categories[c].EstimateGroups[g].EstimateItems[i].PerUnitCost,
new { @disabled = "disabled", @onchange = "costUpdate(this);", @cstType = "perUnit",@id="perUnit"})
<span class="sideLabel">@Model.Categories[c].EstimateGroups[g].EstimateItems[i].PerUnitDescription</span>
if (Model.Categories[c].EstimateGroups[g].EstimateItems[i].Units != null
&& !Model.Categories[c].EstimateGroups[g].EstimateItems[i].IsBasedOnHomeSquareFootage)
{
@Html.TextBoxFor(m => Model.Categories[c].EstimateGroups[g].EstimateItems[i].Units,
new { @disabled = "disabled", @onchange = "costUpdate(this);", @cstType = "units" })
}