Hi.
I have created a WIX New submit form (not the old WIX forms) and using Velo I would like to pre-populate specific fields in the form before it is submitted.
The information I want to fill in is the contact details of a logged-in member of my site.
Including, their First Name, Surname and email address (username).
I’m going to retrieve these values from the Members/PrivateMembersData collection using Velo.
Any idea how to I pre-populate specific fields in a WIX New form?
Many thanks
Mark
Hi, markbpriv !!
Here’s what I discovered when attempting to pre-fill fields in a Wix Form V2 element. I’ll explain the steps I followed, and it seems to work.
First, place the Wix Form element on the page. Click on the element, then click “Edit Form.” This will take you to the form settings page in the dashboard. On that page, you should see a preview of the form on the right-hand side.
For example, if you click on the “First name” field, you’ll see an option for “Settings.” From there, navigate to “Advanced Settings,” where you’ll be able to view the field key for the “First name” field. This field key can be used to pre-fill the form fields via Velo code.
Once you return to the page editor, try entering Velo code like the following:
$w("#YourWixForm'sID").setFieldValues({
yourFieldKey: "I'm test Value",
});
I’m a little concerned about the error showing up in the editor
, but for now, it seems like this method will work for pre-filling the values! 