Pradeep Yadav

Pradeep Yadav

  • 322
  • 5.6k
  • 2.7m

ValidateFor getting triggerd

Jun 15 2021 5:31 PM

Hi,

I have a textarea in my form which is binded to property remark.

When I am adding Required[] annotation. It getting triggered at before submit button.

I have 2 from on the .cshm.

First form also has submit button. On click of thei ssubmit i fetch some data from controller on post and then render second form.

Bt Required validator gets triggered to Remark Tex area.

 <div class="col-md-12">
     <div class="col-md-12">
         <div class="row form-group">
             <label class="required">@Html.DisplayName("Remark")</label>
             <div class="col-md-8">
                 @Html.TextAreaFor(model => model.Remark, new { @class = "", @min = "1" ,maxlength = "255", placeholder = "Remark" })
                 @Html.ValidationMessageFor(model => model.Remark)
             </div>
         </div>
     </div>
 </div>


Answers (1)