# Issue with textBox in Velo - unable to save

**URL:** <https://forum.wixstudio.com/t/issue-with-textbox-in-velo-unable-to-save/68791>\
**Category:** Ask the community\
**Tags:** code, wix, question\
**Created:** [February 17, 2025, 4:41am UTC](https://forum.wixstudio.com/t/issue-with-textbox-in-velo-unable-to-save/68791 "2025-02-17T04:41:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![user588](https://avatars.discourse-cdn.com/v4/letter/u/9dc877/32.png) [@user588](https://forum.wixstudio.com/u/user588)\
**Post date:** [February 17, 2025, 4:41am UTC](https://forum.wixstudio.com/t/issue-with-textbox-in-velo-unable-to-save/68791/1 "2025-02-17T04:41:38Z")

</div>

If a TextBox is filled from a database or a variable when the page is loaded, the command:

` let myValue = $w("#myElement").value;`

does not see the input and just returns a blank unless a user has subsequently edited the TextBox. The same problem does not arise on TextInputs - this seems to be a problem that has developed over the past year as I have pages that used to work that no longer do so.

Please look at the example at: [https://www.northnorfolkstudios.co.uk/textbox-save](https://www.northnorfolkstudios.co.uk/textbox-save)

**Product:**  
Wix Editor

**What are you trying to achieve:**  
I have put an example with the code up at [https://www.northnorfolkstudios.co.uk/textbox-save](https://www.northnorfolkstudios.co.uk/textbox-save)

**What have you already tried:**  
Checked the forums, talked to the Wix AI and left a message for an expert to get back to me.

**Additional information:**  
The example page that I have put up is a very much simplified version of what I am doing. It does highlight the problem though i.e. that the ‘get’ function is flakey when used on TextBoxes.

---

<div class="post-metadata">

**Author:** ![onemoretime](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/onemoretime/32/104023_2.png) [@onemoretime](https://forum.wixstudio.com/u/onemoretime)\
**Post date:** [February 17, 2025, 6:39am UTC](https://forum.wixstudio.com/t/issue-with-textbox-in-velo-unable-to-save/68791/2 "2025-02-17T06:39:44Z")

</div>

Hi, @user588 !!

I’m not entirely sure about the situation, but are you using `dataset.onReady()` for now? 🙃

```javascript
$w.onReady(function () {
    $w("#myDataset").onReady(() => {
        let textBoxValue = $w("#myElement").value;
        console.log(textBoxValue);
    });
});

```

---

<div class="post-metadata">

**Author:** ![Pratham](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/pratham/32/119586_2.png) [@Pratham](https://forum.wixstudio.com/u/Pratham)\
**Post date:** [February 17, 2025, 8:02am UTC](https://forum.wixstudio.com/t/issue-with-textbox-in-velo-unable-to-save/68791/3 "2025-02-17T08:02:14Z")

</div>

Yes, the problem you are facing is legitimate, and here’s the solution:

> [@Unable to Retrieve Input Value](https://forum.wixstudio.com/t/unable-to-retrieve-input-value/52448/2):
>
> No actually its not a dynamic page issue, it is apparently a bug with all input fields. So unless the user takes their cursor over the input box and clicks on it, the input does not consider it as the value you’ve set by code. I was facing the same issue but I managed to solve it using a simple workaround. Try calling the $w('#input').focus(); after assigning a value to the input or before reading the value of that input. This should solve the issue.

> [@Copy the value from #input1 to #input2 and write it to the database](https://forum.wixstudio.com/t/copy-the-value-from-input1-to-input2-and-write-it-to-the-database/60907/2):
>
> Everything’s perfect, just add $w('#input2').focus(); after $w('#input2').value = input1Value;

---

<div class="post-metadata">

**Author:** ![user588](https://avatars.discourse-cdn.com/v4/letter/u/9dc877/32.png) [@user588](https://forum.wixstudio.com/u/user588)\
**Post date:** [February 17, 2025, 12:52pm UTC](https://forum.wixstudio.com/t/issue-with-textbox-in-velo-unable-to-save/68791/4 "2025-02-17T12:52:19Z")

</div>

No, I am not using a dataset in the example in the link. Thank you for looking

---

<div class="post-metadata">

**Author:** ![user588](https://avatars.discourse-cdn.com/v4/letter/u/9dc877/32.png) [@user588](https://forum.wixstudio.com/u/user588)\
**Post date:** [February 17, 2025, 12:58pm UTC](https://forum.wixstudio.com/t/issue-with-textbox-in-velo-unable-to-save/68791/5 "2025-02-17T12:58:03Z")

</div>

Hi Pratham,  
I really appreciate your input. Unfortunately it doesn’t resolve the problem for me. I have tried the $w(‘#input2’).focus() approach both before and after I assign the vaue to the field and it still isn’t seen. I have put an invisible button just above the right-hand column - if you click on that you will see my attempt to implement your solution. I have even added some console.logs. Cheers, Nick

---

<div class="post-metadata">

**Author:** ![codequeen](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/codequeen/32/88960_2.png) [@codequeen](https://forum.wixstudio.com/u/codequeen)\
**Post date:** [February 17, 2025, 1:13pm UTC](https://forum.wixstudio.com/t/issue-with-textbox-in-velo-unable-to-save/68791/6 "2025-02-17T13:13:25Z")

</div>

Your logic approach is incorrect.

You cannot save a value by assigning it to the input value.

You have to setFieldValues via code directly to the dataset.

> **[Set Field Values | Velo](https://dev.wix.com/docs/velo/api-reference/$w/dataset/set-field-values)**
>
> Updates the values of a set of fields in the current item. The setFieldValues function sets the value of a set of fields in the current item.

---

<div class="post-metadata">

**Author:** ![user588](https://avatars.discourse-cdn.com/v4/letter/u/9dc877/32.png) [@user588](https://forum.wixstudio.com/u/user588)\
**Post date:** [February 17, 2025, 2:00pm UTC](https://forum.wixstudio.com/t/issue-with-textbox-in-velo-unable-to-save/68791/7 "2025-02-17T14:00:33Z")

</div>

Hi Codequeen, The thing about my example at [https://www.northnorfolkstudios.co.uk/textbox-save](https://www.northnorfolkstudios.co.uk/textbox-save) is that it doesn’t use a dataset - it is purely illustrative of the problem and shows the difference between the way that textInput and textBox are now working - and in my actual page (of which this is a very simplified example) I am entering data into a repeater (for it to be altered and saved if need be) using wixData not wixDataset.
