Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Radio buttons to display different predetermined text in a text box

Raffe
Level 2
Level 2

Some help please.

I have a form with various numbers of radio button in. some grouped in two options and others with 4 options.

What I would like to happen is that depending on which radio button is selected a predetermined answer is then displayed in the accompanying text box. IE radio button true would insert "true" text in to the text field and again "false" if the false radio button is selected.

The principal would be the same for the 4 option radio buttons in my form.

Any help in this regard will be appreciated.

Raffe.

1 Accepted Solution
Bibhu_Bikash_Na
Correct answer by
Level 9
Level 9

Hi Raffe,

You can set the value of the RadioButtons as you want. Lets say you have set the values as 1,2,3,4.

Then in the click/change event of the radio buttons you can write the following script.

if (this.rawValue == 1)

     {

          TextField1.rawValue = "Anything you want";

     }

else

     {

           TextField1.rawValue = "Anything you want";

     }

For many options you can also use switch case statement.

Thanks,

Bibhu.

View solution in original post

0 Replies
Bibhu_Bikash_Na
Correct answer by
Level 9
Level 9

Hi Raffe,

You can set the value of the RadioButtons as you want. Lets say you have set the values as 1,2,3,4.

Then in the click/change event of the radio buttons you can write the following script.

if (this.rawValue == 1)

     {

          TextField1.rawValue = "Anything you want";

     }

else

     {

           TextField1.rawValue = "Anything you want";

     }

For many options you can also use switch case statement.

Thanks,

Bibhu.

View solution in original post

Raffe
Level 2
Level 2

Thanks Bibhu.

This is just what I was looking for.

Much appreciated.