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

Selcetion field choice show hide

Participant ,
Oct 16, 2022 Oct 16, 2022

Copy link to clipboard

Copied

I have checkboxes and text fields. They are set to hidden.

I have a selection list with several choices. If you choose one 3 certain choices the checkboxs and textfields show.

This is my script, it works great. But what I want to do is have a radio button group with 3 buttons instead of the checkboxs. I tried using the group name, did not work.

How do I change the Check 1 2 and 3 to radio group1 that has choice 1,2 and 3?

 

if(event.value == "Occupational Health Evaluation completed" || event.value == "Occupational Health Surveillance Evaluation completed" || event.value == "Fitness to Work Evaluation completed")
{
this.getField("Text2").display = display.visible;
this.getField("Text3").display = display.visible;
this.getField("Text4").display = display.visible;
this.getField("Text5").display = display.visible;

this.getField("Check1").display = display.visible;
this.getField("Check2").display = display.visible;
this.getField("Check3").display = display.visible;
}
else{
this.getField("Text2").display = display.hidden;
this.getField("Text3").display = display.hidden;
this.getField("Text4").display = display.hidden;
this.getField("Text5").display = display.hidden;
this.getField("Check1").display = display.hidden;
this.getField("Check2").display = display.hidden;
this.getField("Check3").display = display.hidden;
}

 

TOPICS
How to , JavaScript , PDF forms

Views

489

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
1 ACCEPTED SOLUTION
Community Expert ,
Oct 16, 2022 Oct 16, 2022

Copy link to clipboard

Copied

No need for double posts.

Try this:

if(event.value == "Occupational Health Evaluation completed" || event.value == "Occupational Health Surveillance Evaluation completed" || event.value == "Fitness to Work Evaluation completed")
{
this.getField("Text2").display = display.visible;
this.getField("Text3").display = display.visible;
this.getField("Text4").display = display.visible;
this.getField("Text5").display = display.visible;
this.getField("group1").display = display.visible;

}
else{
this.getField("Text2").display = display.hidden;
this.getField("Text3").display = display.hidden;
this.getField("Text4").display = display.hidden;
this.getField("Text5").display = display.hidden;
this.getField("group1").display = display.hidden;
}

View solution in original post

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 ,
Oct 16, 2022 Oct 16, 2022

Copy link to clipboard

Copied

No need for double posts.

Try this:

if(event.value == "Occupational Health Evaluation completed" || event.value == "Occupational Health Surveillance Evaluation completed" || event.value == "Fitness to Work Evaluation completed")
{
this.getField("Text2").display = display.visible;
this.getField("Text3").display = display.visible;
this.getField("Text4").display = display.visible;
this.getField("Text5").display = display.visible;
this.getField("group1").display = display.visible;

}
else{
this.getField("Text2").display = display.hidden;
this.getField("Text3").display = display.hidden;
this.getField("Text4").display = display.hidden;
this.getField("Text5").display = display.hidden;
this.getField("group1").display = display.hidden;
}

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 Beginner ,
Oct 17, 2022 Oct 17, 2022

Copy link to clipboard

Copied

LATEST

Yes, it is working very well. It is fantastic.
Thank you very much for your help!!

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