Dynamically add new input field

Hey, guys, I was thinking about adding input field with a plus button click on form i.e user presses the ‘+’ button and an input field appears (the user can have any no. of input fields).
Can anyone please suggest me how to do it??

refer this forum link…How to add text field dynamically

1 Like

Thanks Rupnesh, it did work but can you explain how can i send the input value of those forms to the backend??
Like if someone created 3 more input forms using the add button how can I catch and send those values to backend??

submitData() {
  let doc_name_txtvalues:any=[];
  let doc_add_txtvalues:any=[];
  let doc_cont_txtvalues:any=[];

  for(let i=0; i<=this. MySelect1.length;i++) {
    doc_name_txtvalues.push(this.doc_name[i]);
    doc_add_txtvalues.push(this.doc_add[i]);
    doc_cont_txtvalues.push(this.doc_cont[i]);
  }
  //pass the doc_name_txtvalues,doc_add_txtvalues,doc_cont_txtvalues to api.

  //or--------------------------------
  let dataarray:any=[];
  for(let i=0; i<=this. MySelect1.length;i++) {
   dataarray.push({"name":this.doc_name[i],"add":this.doc_add[i],"cont":this.doc_cont[i]});
  }
  //pass the dataarray to api.
  
}

Will it work with pdfmake??
As i want the values to be printed on a pdf file.

1 Like

Hello this post was very helpful to me. if any one can help me on , once i add multiple items , i would like to generate a pdf file is it possible. please if any one can help me out i would be very thankful

Yes it is possible to generate a pdf file by using ionic plugins.

If any link or any code is available pls send me the link or code. thanks