How to validate a form

how to validate a form while submit my form. please help me out
Thanks in advance

hello ,

follow this tutorial you will get better idea how to validate form.

1 Like

Thanks for your reference. but am want to valid form onsubmit do you have any reference or sample of source code.?

HI you can use the code like this:

  <form #f="ngForm">
`  <ion-input type="text"  ngModel required name="first_name" #First_NameCtrl="ngModel"></ion-input>`
</form>

After this with the ( required ) this input will be valid. You can disable the submit button untill the form is not valid:

<button ion-button full color="danger" style="background-color: #f53d3d73;" [disabled]="!f.valid"> Sign Up </button>