Hello,
I am trying to update a Plain Text field with new text with jQuery code. Below is my code:
fd.rendered(function () {
function changeText() {
fd.control('Text1').text = "Here I changed the text";
console.log("code executed")
}
changeText();
});
In the console I can see that the code executed, but the control's text does not change in the form preview.
Thanks for the help,
Michael M.
Dear @mmendes,
Unfortunately, this doesn't work as there is no Plain text control anymore in Public Web Forms, the Text control is actually Rich text, so the following code should work:
fd.control('Text1').$el.innerHTML = "Here I changed the text";
Thank you, Nikita! That code worked perfectly.
Can you direct me to an updated documents page with this change?
-Mike M.
Dear @mmendes,
Currently, no update to documentation, though we're working on it. We're going to add a new property for the Text control to change the text directly, without using the $el.innerHTML property, but this method will keep working.