Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Ionic2 required form controls not styled

$
0
0

@kemaltolga wrote:

I have a form in markup like this....

<ion-content padding>
    <form [formGroup]="incidentForm">
        <ion-item>
            <ion-label color="dimmed">Survey Number</ion-label>
            <ion-input formControlName="surveyNumber"
                type="text"></ion-input>
        </ion-item>
        <div padding>
            <button ion-button
                type="submit"
                [disabled]="!incidentForm.valid"
                color="primary">
                   Submit</button>
        </div>
    </form>
</ion-content>

I then code the formGroup like this.

this.incidentForm = this.formBuilder.group({
      surveyNumber: ['', Validators.required]
    });

My expectation is that the form input element would get a "red" bottom border. But that doesn't happen until I input data, then remove it again.

Thanks
--tolga

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



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