Pass Parameters from Form to form

I have 2 forms - Form A and Form B

Form A has a dropdown box with Values of USA States ( Ex CA , MN, MA etc).
Based on user selection we need to display corresponding state details in Form B

I want to pass user selection as URL parameter in Form A & read the parameter in Form B.

I am not able to find how to pass and read parameters in the examples

Can you please help with example ?

1 Like

Hey Vasudeva,

If you’re using wix-location , you can pass q query parameter in the “to()” method and retrieve it using the “query” property .

Let me know if that worked for you,
J

Thanks Avinor . I am not able to get the value in Page 2

Page 1
export function button1_click_1(event, $w) {
//Add your code for this event here:
let myValue = $w(“#dropdown1”).value;
wixLocation.to(“/testquiz?module=”+ myValue)
}

Page 2
import wixLocation from ‘wix-location’;

$w.onReady(function () {
let myquery = wixLocation.query;
console.log(" Query Parameter is " + myquery);

});

Console log : Query Parameter is : [object Object]

Fixed the issue
let myquery = wixLocation.query;
quizCode.module