Trying to set the value of a input box

We have form downloads on our site, we ask for normal things (name, email, company, phone, etc etc) before allowing the download. What we want to do is once the user fills out this information once, they shouldn’t have to re-fill out the same information over and over again.

I created a process to save the info in a cookie, and everything works to write the info into the cookie and the code can read it fine. But there is nothing I can do that’ll put the data into the text input box to finally fulfill the whole purpose of this:

if (cookieSaved === “Y”) {
console.log(“Mark 2”);
$w(“#name”).value = local.getItem(“name”);
$w(“#lastName”).value = local.getItem(“lastName”);
$w(“#company”).value = local.getItem(“company”);
$w(“#phone”).value = local.getItem(“phone”);
$w(“#email”).value = local.getItem(“email”);
$w(“#companySize”).value = local.getItem(“companySize”);
}

So yeah, the whole X.value deal just flat out don’t work. Nothing happens, but I get the “Mark 2” in the log, also logged each element to make sure that was being read it correctly… it is. It just won’t change the text boxes.

Hmmm. In fact - double hmmmm.

Please post the URL of your site. Only authorized Wix personnel can get access to your site in the editor.

This is the dyanamic page where the code is currently running…

Thanks again Yisrael. :sunglasses:

I’ve been having this same problem. Was there ever a solution found for it?

1 Like

I am having the same issue, .value is working on one page, but not another.

It’s been a loooong time since I asked for help with this issue but I remember it was about input fields not populating when connected to a dataset. I got around this by simply coding everything to reference the databases directly and just skip the datasets altogether.

Unfortunately, I can’t help you if you’re looking to utilize the cookie method as mentioned in the original post.

1 Like

I am having same problem - input box is not connected to dataset but I can’t populate it…

I’m storing the value of an input field from a lighbox in a session variable and then calling a page. When I go back to lightbox … the session variable has magically changed back to the old value… and populated the input value that is ‘cached’ in the old session variable…