Personalized text with user form input

Hi everyone!

I am very new to coding and to WIX! So apologies in advances for wasting your time with such a basic question, but I ran out of ideas and need a little push.

Here is the thing:

I created a new collection, linked it to a form and then linked the submit button to the dynamic page (title).

In the dynamic page (title) I want to display a text with the name and the company the user input on the form.

So I understand that I need to define name, but I dont know how to do that… can you help?

I am getting ‘Welcome undefined’ instead of Welcome (title)…

So this is my linked for to the Database

And when click submit, I redirected to the dynamic page (title), but the welcome text doesnt add the $name input in the form, stored in the database

here what I coded…

import wixData from 'wix-data';

$w.onReady(function () {

let name = $w("#name").value
$w("#linktext").text = `Welcome ${name}`;


The element called #name is on the original page, so the page you are displaying the value on is on a page that doesn’t have an element called #name to pull the value from.

To make this work you should use the wix-storage API to set the value of the name field to the local storage when the user clicks the submit button. Then on the next page you can get the item from the storage and display the value.

Hope this helps!

Dara | Corvid Team

Hi Dara,

Thanks so much for the reply.
I still have an issue.

I added the code in the form page and is telling me is not a valid selector

and on the dynamic page where I want to display the value, everything seems right. but still not working… what I am doing wrong?

Ok I corrected the selector!

But is still not working

And I also changed the element to input4 on the dynamic page code

But it is not working :frowning: any help will be greatly appreciated

Now back to you. What do you want to achieve?
Why you are using Wix-Sotrage, when you already have a dataset?

Oh Cool! Thanks for the follow up Russian-Dima.

I want any visitor to fill the form, with Name, LastName and Company Name.

When they press submit, the visitor will be taken to the dynamic page (title) where a personilized text message will have their name.

Eg: Dear $Name, welcome to the page.

Your FORM is on which site? Normal site?

Is this the right situation?

  1. You have a normal PAGE-A?
  2. You have a DATABASE-X?
  3. You have a Dynamic-Page-B?
  4. DATABASE-X is connected with with DYNAMIC-PAGE-B (via DYNAMIC-DATASET)?

The form is on PAGE-A ???

Now you want to have the NAME of a USER to have on the DYNAMIC-PAGE, after submitting the form ?

Right situation?

If so, then you surely do NOT need the Wix-Storage.

When you submit your DATA, it should be written into your DATABASE-X right?
There you will have some columns/references (column1: NAME, column2:LAST-NAME and so on).

The data you need is already there in your DATABASE-X.

The only problem is, i think you will have to CODE the SUBMISSION-PROCESS.

Yes, you described the situation correctly.

I thought there was an easy way to GET the Name from the Database directly into the text in the dynamic page.

Thanks for the advice, I will start working on your suggestion.

This is what you will be need…

$w("#yourDynamicDataset").setFieldValue("title", "New Title");

$w.onReady( () => {
  $w("#yourDynamicDataset").onReady( () => {
    $w("#yourDynamicDataset").setFieldValue("title", "New Title");
import wixLocation from 'wix-location'; your dynamic URL);

Put all these code-parts to a single-code together and expand a little bit this code and you will be able to achieve your aim.

On the dynamic page you also will have to put in some code, which will load data immediately from the database, when page is loaded (onLoad).

$w.onReady( () => {
2  $w("#yourDynamicDataset").onReady( () => {
3    let itemObj = $w("#yourDynamicDataset").getCurrentItem();
4    console.log(itemObj)
5  } );
7} );

Do not forget to set the dynamic dataset to read and write.

If this way does not work, write again here :grin:, then we will do it in another way .


You have the setItem function added to the page onReady(). When the page loads it will save the blank value to the storage.

As I said add the setItem function to a button click event for your submit button.

You also named the key “name” when setting the item but when you are using getItem you called it “input4”.

Hope this helps!

Dara | Corvid Team