Hello Everyone,
I have a trip website. So on page 1 I have a drop-down with each month of the year. when the user select a specific month, the available trips appear.
Now, I need to make page 2. On this page, there will be more details about the specific trip the user chose in the previous page, as well as another drop-down with month of each year. This way if he decides to check other dates for this trip, he does not have to go back to page 1 again. Makes sense, right?
My problem is, how do I make the default month selection on page 2 be the selected month from page 1?
So for example, on page 1 you select November 2020, You see a nice trip to the maldives. You then click on the trip button, which will take you to page 2 with details about this trip.
Right now, When he goes to page 2, he must re-select the month again (which is not so nice). I want the page 2 drop-down to load and show November 2020, with also the option to change it.
Thanks in advance.
Another option would be to use wix-storage to save the input values so that they are available to the other pages. For example:
// on all of the pages you will need this import statement:
import {session} from 'wix-storage';
// on page one, save a selected value like this:
let selected_month = $w("#dropdown").value; session.setItem("month", selected_month);
// on page two, retrieve the value from page one like this:
let value = session.getItem("month");
Using wix-storage, you can store all of the values from your pages and have them available for use wherever you want.
Just make it manually, so for example on page one on your learn more button
Page 1
onReady-> onButtonClick(evet) -> make a GET to determine the url of next item (id //is withn event -> target) let newUrl = url+"?selectedMonth="+month wixLocation.to(newUrl)
Page 2
onReady ->
let query = wixWindow.query (make sure to import it) if(query) { var selectedMonth = query.seleectedMonth } $w(Page2dropdown).value = selectedMonth