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

How to post multiple input fields to server as a json object

$
0
0

@sreejith13 wrote:

Hai there,
Iam relatively new to the ionic app development.
Now i am face a problem that,i need to send multiple input field which generate dynamically from the mysql php.
ie, i have a input field which i can be updated and send to the server that is my requirement.

Now i am able to get data from my server and generate the input field.but iam unable to send the (updated if any) to the server back

here is the screenshot.

here is html template

type or paste code here
```  `<ion-list>
  <ion-item no-margin="">
  <ion-grid>
    <strong><ion-row>
      <ion-col>Student code</ion-col>
      <ion-col>name</ion-col>
      <ion-col>phone</ion-col>
    </ion-row>
    </strong>
  </ion-grid>
  </ion-item>
  <ion-grid>
    <ion-row *ngFor="let student of students">
      <ion-col >{{student.student_code}}</ion-col>
      <ion-col>{{student.full_name}}</ion-col>
      <ion-col ion-item=""><ion-input  maxlength="10" required [(ngModel)]="student.phone"></ion-input></ion-col>
    </ion-row>
  </ion-grid>
</ion-list>`


here is the .ts file

loadStudents(division){
this.rest.loadStudents(division)
.subscribe(data=>{
this.students=data;

  },error1 => {
    console.log(error1);
  });

}

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>