Pricing Blog

How do you pass data from one page to another?

  • fuelmeup-1241560165216686214

    AY EYE

    1 year ago

    I have one page and it does a search and I want to create another page that shows the search results to the next page.

    How do I do that? Or is it better to just load the results on the same page and do a hide/show based on the results?
  • Tod-1241560166445482096

    Tod

    1 year ago

    Great energy @AY EYE! Your continuous contribution to the toddle Community just made you advance to Community Level 3!
  • lucasg-1241563481824821268

    Lucas G

    1 year ago

    It depends on what you are trying to show
  • Think of it from a user perspective and you'll likely determine the best way to do it
  • That said, you can pass data to another page using URL parameters
  • For example, I use them to redirect a user back to the page they came from after they log in
  • One of the many ways they can be used
  • fuelmeup-1241564597899759638

    AY EYE

    1 year ago

    So what im doing is search input, when submit call API, and then i want to redirect them to another page that has data from that original search
  • @Lucas G
  • lucasg-1241565166894841966

    Lucas G

    1 year ago

    I don't know what app you are trying to build but I would think that staying on the same page would be a nicer user experience
  • You could pass the search input as a URL param
  • Or you might also be able to use local storage
  • lucasg-1241565645536235550

    Lucas G

    1 year ago

    I think my vote is to stay on the same page if possible, but again, can depend on what you are looking to do
  • URL params and/or local storage could be your tools to accomplish it though
  • fuelmeup-1241566079264886876

    AY EYE

    1 year ago

    Okay, thank you @Lucas G Will just do same page, easier for learning atm, thanks
    👍1