Question:
Hi, I am using a the new forms (v2). And I trying to inject value into a dropdown or a single choice element
Product:
Wix Editor
What are you trying to achieve:
I am collecting a local storage value that was set in a previous page.
And trying to dynamically set the value for either a dropdown or a “single choice” element
What have you already tried:
I was able to inject the value into a regular short input text box (it is different in Forms V2 - the new forms. but this works:
import { local } from "wix-storage-frontend";
$w.onReady(function () {
let ref = local.getItem("my-data");
console.log("I got " + ref)
$w("#myForm").setFieldValues({
myField1: ref,
});
});
This worked, but due to the “closed” environment of the new Forms - I couldn’t find how to populate a dropdown or a single option.
BTW I do know the key of that drop down, I just don’t know how to access it.
Thanks
Gidon