locked
How to send two different form values in a button click RRS feed

  • Question

  • User-1744141586 posted

    I need to send MobileNo and Id of below code, while clicking last button(Request OTP). How it is possible? Can anyone help me out...


    <form id="register-form3" #registrationForm="ngForm" (ngSubmit)="OnSubmit(MobileNo.value)">
    <ion-list id="register-list11">
    <ion-item id="register-input8">
    <ion-label>
    Phone Number
    </ion-label>
    <ion-input type="number" #MobileNo ngModel name="MobileNo"placeholder=""></ion-input>
    </ion-item>
    </ion-list>
    <button id="register-button7" ion-button color="positive" block>
    Search Bank
    </button>
    <div class="row" *ngIf="userClaims">
    <div class="col s12 m7">
    <div class="card">
    <!--interpolation-->
    <div class="card-content">
    <div *ngFor="let order of userClaims" style="border: 1px solid lightgrey; padding: 15px; margin: 5px 0;">
    <span> Id : {{ order.Id |json }}</span> <br>
    <span>Name : {{ order.Name | json }}</span> <br>
    <span>Address : {{ order.Address }}</span> <br>

    </div>

    </div>
    </div>
    </div>
    <button id="register-button8" ion-button color="positive" type="button" (click)="OnPress(MobileNo.value, Id.value)" block>
    Request OTP
    </button>
    </div>
    </form>

    Wednesday, March 28, 2018 5:56 AM

All replies

  • User-1516073966 posted

    Hi,

    Create an hidden field as a ngModel and submit the form with both.

    <ion-input type="hidden" #Id ngModel name="Id"></ion-input>

    Thanks,

    Chandra

    Thursday, March 29, 2018 6:38 AM