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.
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.
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
Hi Codequeen, The thing about my example at 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.