Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

FormCalc or Javascript for radio buttons?

Avatar

Level 2

I need to write a script that uses radiobuttons.

If a radiobutton is selected (my radiobuttion is called rbJanuary) then textbox1 = textbox2.

How would I write this and should it be in FormCalc or Javascript? Thanks!

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

it doesn't matter which language you use for your request, it will work in both while FormCalc has a slimmer syntax.

FormCalc:

if ($ eq 1) then

          Textfield1 = Textfield2

else

          Textfield1 = ""

endif

JavaScript:

if (this.rawValue === "1") {

          Textfield1.rawValue = Textfield2.rawValue;

} else {

          Textfield1.rawValue = "";

}

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi,

it doesn't matter which language you use for your request, it will work in both while FormCalc has a slimmer syntax.

FormCalc:

if ($ eq 1) then

          Textfield1 = Textfield2

else

          Textfield1 = ""

endif

JavaScript:

if (this.rawValue === "1") {

          Textfield1.rawValue = Textfield2.rawValue;

} else {

          Textfield1.rawValue = "";

}