RadzenTextBox bind from JavaScript empty value

Hello,

I have a RadzenTextBox that is bound from JavaScript. Visually the value is seen in the control, but when I access its value through the code it is empty.

//Declaration of variable
string signature = "";

<RadzenTextBox id="txtSignature" @ref="txtSignature" @bind-Value="@(signature)" Style="width: 100%" Change="@(args => OnChange(args))" />

//JavaScript
document.getElementById('txtSignature').value = "Hello";

I've tried putting the Change event on it, but it doesn't fire.

I need help with this.

Thank you very much in advance.

I think you need to trigger the change event of the input DOM element after setting its value. This would hopefully make the Blazor runtime to sync it with the property.

1 Like

It works!

Thank you very much.