Ionic Form button+

Hi i have a form into my ionic App, i have 2 input:type= text. And a button.I need to press the button, save the data and take it to another page, this page will appear as a list

Image show the button add +, this button redirect to the form, and when the form data it’s save,This has to return to the page with the button +


Whats your question/problem exactly? Where are you stuck?

1 Like

I am developing an assistance app for my school, one of the pages, it has a button to add, I want it to click on the button, this will take me to a form, where you can put the first and last name, and when you click in sending, this takes to the page that has the button to add +, and adds the name and the last name in card form

And you want that we help you with the code or where are you stuck? Or do you want feedback on whether your plan is good?

We know now what you want to do, but we don’t know how to help you.
Where is your problem?

My problem is that I do not know how to do that when I click on the “Send” button, it takes me to the page with the + button and the information is displayed as a card


1 Like

and you can use ionic g page 'new page name' to create new pages easily. :wink:

1 Like

This is that i need

Do you have already every page setup?

1 Like

Yes i have all the pages setuped(1st page and 2nd page)

Ok lets get into that:

You need a provider for your data. with two functions:
A function to get and to add data from/to a var.

You can turn your second page into an modal or you could use NavPush to open it and Nav pop to close it again after calling the add function on the provider with the data.

Maybe you want to also add persistence to your list, so that it doesn’t get lost after closing the app.

If you can tell us more about the purpose of your app we might be able to give you more advice - as exaple if you want to share the list wit other app users or sth like that.

The application will be for each tutor and this will be connected to firebase. I need the names to be synchronized with the phones of the other preceptors

then you can add the firebase functionality to your provider. And review your Privacy Policy when your working with the cloud and schools - they might have some requirements for the data safety.

Yeah sure, But how would the 2 functions you mentioned be? function get and add dta from/to a var??
I have to code it in php or in Angular??

list:{name,lastname}[] =[] ;

constructor () {} 

get() {
 return list;

add(name:string,lastname:string) {
 this. list.push({name:name, lastname:lastname}) ;

something like that in your provider, you can add firebase support to this functions in the provider later I think.

Thanks man, is it programmed in php or Angular?

no let php out of your client code. php is a server language.
this what I sent you is typescript.
Maybe you should do some tutorials first before doing your own app to learn the basics first.

you can create a provider with ionic g provider 'provider name'

1 Like