Expand my Community achievements bar.

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

textfield must validate imput on checkbox.

Avatar

Level 2

Hello all,

In my form I have 4 checkboxes. If you select the checkbox, it is required to give some additional information. But theres only one textfield for 4 checkboxes.

Is it possible to create a code that the textfield validate if there is an imput in the checkboxes?

Greetings,

Timo

1 Accepted Solution

Avatar

Correct answer by
Level 9

Hi Timo,

Put this following script in the change event of every checkboxes.

if (CheckBox1.rawValue == 1 || CheckBox2.rawValue == 1 || CheckBox3.rawValue == 1 || CheckBox4.rawValue == 1)

     {

          TextField1.mandatory = "error";

     }

else

     {

          TextField.madatory = "disabled";

     }

Thanks,

Bibhu.

View solution in original post

4 Replies

Avatar

Level 9

Hi Timo,

I guess it's possible. But what exactly do you want to do ?

Thanks,

Bibhu.

Avatar

Level 2

I attached an image. Her you see the "form"

You see field 1. This textfield must check if one or more of the checkboxes are on/filled. If one or more of the checkboxes are on/filled the textfield is required.

Greetings,

Timo

form.jpg

Avatar

Correct answer by
Level 9

Hi Timo,

Put this following script in the change event of every checkboxes.

if (CheckBox1.rawValue == 1 || CheckBox2.rawValue == 1 || CheckBox3.rawValue == 1 || CheckBox4.rawValue == 1)

     {

          TextField1.mandatory = "error";

     }

else

     {

          TextField.madatory = "disabled";

     }

Thanks,

Bibhu.

Avatar

Level 2

Hi Bibhu,

Thanks, this script works.

greetings,

Timo