Javascript set field on form


I'm a newcomer and struggling. I have a simple form with a textinput fields. I want to use javascript to set the value of that fields when I click a button.

I've created a RUN JS Resource that has the single line:

{{textInput3.value}} = "Hello World";

I attached that resource to a button.

When I run the query in the developer panel, it tells me query ran succesfully, but nothing happens. When I change to preview mode and click the button, a message flicks past for about a microsecond, but the field doesn't display "Hello World" (or anything else).

I'm probably doing something very simple very wrong...

Help, please!

Thanks - Chris

Hey Cris - welcome to the forum.

You can run a script or attach a JS query with the following code in your example:

textInput3.setValue("Hello World")

Hi Stefan,

Thank you!



Forget about my email below. It suddenly started working,