Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

188
Views
Wix: (Javascript) Carry information from a page to another

Issue: Unable to jump and filter information on webpage based off the information from another webpage

Background/Intended behavior: I have 3 web pages: 1. Home Page 2. Law Page 3. Medical Page. Pages 2: Law & 3: Medical, have checkboxes that can filter a repeater of linked images on that page.

From the Home Page the user selects from two dropdown lists: Task and Location. Both task and location are required prior to clicking on a search button. When button is clicked, if the task == a Law task, then user will jump to the law page and the repeater will filter by the task selected and location. (Example: Task = fire fighter / Location = Dallas) Expected Result:

  1. User jumps to Law page
  2. Repeater is filtered by fire fighters in Dallas

The same behavior would apply if a Medial task was selected instead of a Law task. (Example: Task = dentist / Location = Dallas) Expected Result:

  1. User jumps to Medical page
  2. Repeater is filtered by dentist in Dallas

Problem 1: I have searched a lot on Wix.com on how to code for a page to jump to another page based off the information entered. I desire to do an if statement checking the value of the task dropdown list, but I cannot find out how to jump to another page using javascript code in wix.

Problem 2: I also desire to carryover values from one page to be applied in another. Should I just have a global variables that by default is blank but can be altered between all three pages? Then upon load of pages 2 & 3 use that values for the variables to display the filters?

about 4 years ago · Juan Pablo Isaza
3 answers
Answer question

0

I would create a JSON object to hold the desired values using localStorage. Then call those values to the desired elements when loading the next navigated page.

about 4 years ago · Juan Pablo Isaza Report

0

Thank you everyone for your assistance with finding a solution. It is a simple question, but becomes very complicated as it pertains to the Wix platform and using their API.

Solution 1: I used wix-location module to redirect user to another page. Relocation worked as desired.
Solution 2: I used wix-storage to store value across pages. Information was stored as desired, and recalled using the session.getItem().

[HOME PAGE]

import wixLocation from 'wix-location'; import {session} from 'wix-storage';

export function exploreSearchButton_click(event) {

if(($w('#categoryDropdown').value.length>0)&&($w('#stateLocationDropdown').value.length>0))
{
    session.setItem("location",$w('#stateLocationDropdown').value);

    switch($w('#categoryDropdown').value)
    {
        case "Doctor" :
            session.setItem("category",0);
            wixLocation.to("/medical-field");
            break;
        case "Dentist" :
            session.setItem("category",1);
            wixLocation.to("/medical-field");
            break;
            ...
        case "Police Officer": 
             session.setItem("category",0);
            wixLocation.to("/civil-service-law");
            break;
        case "Fire Fighter": 
             session.setItem("category",1);
            wixLocation.to("/civil-service-law");
            break;
      ...
        default: 
            console.log("Did not jump to another page.");
    }
}

}

[MEDICAL PAGE]

import {session} from 'wix-storage';

$w.onReady(function () {

let newCategory = parseInt(session.getItem("category"));

if(newCategory>=0)
{
    $w('#categoriesCheckboxGroup').selectedIndices = [newCategory];
    $w('#stateLocationDropdown').value = session.getItem("location");
}
        displayServicesInRepeater("medical-field"); 

Thank you all for your assistance.

about 4 years ago · Juan Pablo Isaza Report

0

With php you can use the if and else attributes with the html form attribute you can use checkboxes and with if you can redirect the user to the desired page with an echo ‘window.location’.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!