Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49087

Required property ion-label not working

$
0
0

I am trying to add the ‘Required’ property to an ion-input wrapped in an ion-item within a form. I have looked at the Ionic 5 docs and tried the following:

 <form  #f="ngForm" (ngSubmit)="onSubmit(f)">
    <ion-item>
      <ion-label position = "floating">Investigation Name: </ion-label>
      <ion-input autofocus = true autocorrect = "on" required clear-input = true [(ngModel)]="data.investigation" name="investigation"></ion-input>
    </ion-item>

But when I submit the form the input field can be left blank.
I have also tried setting the required property in the form tag but same result.

Thanks in advance

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 49087

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>