Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

189
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda