Required Validation message not showing up in reactive form submit

Hi Team,

I am using NumericTextBox control with in reactive form, I am not able show required validation when the value is null.

please find below code I have used

<div class="col-md-6 col-lg-6">
            <label for="txtpollInterval" class="control-label glyphicon-asterisk mandatory">Poll Interval in Minutes</label>
            <ejs-numerictextbox formControlName="pollInterval" id="pollInterval" format="n0" floatLabelType='Always' ></ejs-numerictextbox>
            <div *ngIf="submitted && f.pollInterval.invalid" class="invalid-feedback">
              <div *ngIf="f.pollInterval.errors.required">Poll Interval is required</div>
            </div>
          </div>
I saw the sample over here and implemented the same, but not worked out for me, also the ./app/template.html missing in the samle.

Thanks,
Shiva

1 Reply

SN Sevvandhi Nagulan Syncfusion Team February 28, 2020 11:00 AM UTC

Hi Samba,  
 
Greetings from Syncfusion support.  
 
We have checked the shared code snippet. In the shared code snippet you have missed the controls in formGroup. Kindly refer the below code snippet, 
 
<ejs-numerictextbox formControlName="pollInterval" id="pollInterval" format="n0" floatLabelType='Always'></ejs-numerictextbox> 
<div *ngIf="f.controls.pollInterval.invalid && (f.controls.pollInterval.touched)" class="invalid-feedback"> 
    <div *ngIf="f.controls.pollInterval.errors.required">Poll Interval is required</div> 
</div> 
 
Please find the sample below, 
 
 
Regards,  
Sevvandhi N  



Loader.
Up arrow icon