• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Checkbox is checked when other checkbox is checked +certain value appears on another field

Participant ,
Sep 04, 2021 Sep 04, 2021

Copy link to clipboard

Copied

Hi
you can create a function for which, a Checkbox is checked when other checkbox is checked and at the same time a certain value appears on another field?

TOPICS
JavaScript

Views

257

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 04, 2021 Sep 04, 2021

Copy link to clipboard

Copied

Should the value of these fields be determined only be the check-box, or should the user be able to manually edit them?

And should they clear when the check-box is unticked?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 04, 2021 Sep 04, 2021

Copy link to clipboard

Copied

the value of these fields be determined only be the check-box

And they should be cleared when the checkbox is unchecked

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 04, 2021 Sep 04, 2021

Copy link to clipboard

Copied

Then you can use the custom calculation script of the text field to do it.

For example, if the check-boxes are called Checkbox1 and Checkbox2 the code would be something like this:

 

this.getField("Checkbox2").checkThisBox(0, this.getField("Checkbox1").valueAsString!="Off")
event.value = this.getField("Checkbox1").valueAsString!="Off" ? "Some text" : "";

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 05, 2021 Sep 05, 2021

Copy link to clipboard

Copied

Hi
thank you very much for your help. Your work is perfect.
I phrased the question wrong. I give an example. suppose my checkbox is "Checkbox1".
If I flag "Checkboxe1" and the word "ACDC" appears in the "TextField1" field, the second checkbox called "Checkbox2" is automatically selected. If "Checkbox1" is not checked, "CheckBox2" is also not checked. If the word "ACDC" does not appear in the "TextField1" field, the "CheckBox2" is not selected (= "OFF").
It is this type of function that I am looking for

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 13, 2021 Sep 13, 2021

Copy link to clipboard

Copied

LATEST

Many thanks for the help. Problem solved

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines