Skip to main content
Known Participant
June 24, 2021
Question

[DUPLICATE, LOCKED] Making rows hidden or visible based on dropdown entry in another field.

  • June 24, 2021
  • 2 replies
  • 151 views

I am wondering how to make a field hidden unless a user selects "Deficient" in which case 

the field then becomes visible populated as "Deficient".

 

the code I have currently which is not working:

 

var deficientB1 = true;
if(this.getField("AnalysisB1").valueAsString = "Deficient") deficientB1 == false;

if (deficientB1 = true)
this.getField("Element_Row_1").display = display.hidden;

if (deficientB1 == false)

this.getField("Element_Row_1").display = display.visible;

 

I also have this code which is designed to only populate a field if "Deficient" is selected but is instead populating the field no matter what option the user selects from a dropdown:

var AnalysisB1 = this.getField("AnalysisB1").valueAsString;
if(AnalysisB1 = "Deficient")
event.value = this.getField("AnalysisB1").valueAsString;
else if (AnalysisB1 = "Repeat Deficient")
event.value = null;
else if (AnalysisB1 = "In Compliance")
event.value = null;
else if (AnalysisB1 = "Remark")
event.value = null;
else if (AnalysisB1 = "Not Applicable")
event.value = null;
else if (AnalysisB1 = "Not Evaluated")
event.value = null;

    This topic has been closed for replies.

    2 replies

    try67
    Community Expert
    Community Expert
    June 24, 2021
    Nancy OShea
    Community Expert
    Community Expert
    June 24, 2021

    [Moderator moved from Using the Community (forums) to Coding Corner.]

     

    Nancy O'Shea— Product User & Community Expert