Copy link to clipboard
Copied
Hello,
I'm very new to Java Script and I'm trying to create a form that will only show certain fields dependant on what is selected in the drop down menu. Can you please help me figure out what is wrong with my code?
If they select "Special Merit Increase" from the drop down box then I want fields "GivenFor SpecialMeritIncrease", "AmountInfo", "Enter%Step" to appear.
if(this.getField("Award_Type").value==("Special Merit Increase"){
event.target.display=display.visable;}
this.getField("GivenForSpecialMeritIncrease").display = fieldHide;
this.getField("AmountInfo").display = fieldHide;
this.getField("Enter%Step").display = fieldHide;
else{
if(this.getField("Award_Type").value==("Premium Pay Award")}
event.target.display=display.visable;}
this.getField("GivenForPremiumPay").display = fieldHide;
this.getField("PremiumPayAmount").display = fieldHide;
this.getField("$TotalAmount").display = fieldHide;
this.getField("$WeeklyAmount").display = fieldHide;
Thank you advance!
Copy link to clipboard
Copied
Update:
I got it to work using the following code:
if(this.getField("Award_Type").value=="Special Merit Increase"){
this.getField("GivenForSpecialMeritIncrease").display = display.visible;
this.getField("AmountInfo").display = display.visible;
this.getField("Enter%Step").display = display.visible;
}else{
this.getField("GivenForSpecialMeritIncrease").display = display.hidden;
this.getField("AmountInfo").display = display.hidden;
this.getField("Enter%Step").display = display.hidden;
if(this.getField("Award_Type").value=="Premium Pay Award"){
this.getField("GivenForPremiumPay").display = display.visible;
this.getField("PremiumPayAmount").display = display.visible;
this.getField("$TotalAmount").display = display.visible;
this.getField("$WeeklyAmount").display = display.visible;
}else{
this.getField("GivenForPremiumPay").display = display.hidden;
this.getField("PremiumPayAmount").display = display.hidden;
this.getField("$TotalAmount").display = display.hidden;
this.getField("$WeeklyAmount").display = display.hidden;
}
}
Copy link to clipboard
Copied
Update:
I got it to work using the following code:
if(this.getField("Award_Type").value=="Special Merit Increase"){
this.getField("GivenForSpecialMeritIncrease").display = display.visible;
this.getField("AmountInfo").display = display.visible;
this.getField("Enter%Step").display = display.visible;
}else{
this.getField("GivenForSpecialMeritIncrease").display = display.hidden;
this.getField("AmountInfo").display = display.hidden;
this.getField("Enter%Step").display = display.hidden;
if(this.getField("Award_Type").value=="Premium Pay Award"){
this.getField("GivenForPremiumPay").display = display.visible;
this.getField("PremiumPayAmount").display = display.visible;
this.getField("$TotalAmount").display = display.visible;
this.getField("$WeeklyAmount").display = display.visible;
}else{
this.getField("GivenForPremiumPay").display = display.hidden;
this.getField("PremiumPayAmount").display = display.hidden;
this.getField("$TotalAmount").display = display.hidden;
this.getField("$WeeklyAmount").display = display.hidden;
}
}
Copy link to clipboard
Copied
Trying to do something similar here.
I only have two Conditions in my Drop Down Menu:
If Drop Down (Contract Date) = Contract Start Date, Do Not Show Fields - Prorated Service Start Date Text, Prorated Service Start Date, or Prorated Invoice to Follow.
If Drop Down (Contract Date) = Renewal Date, Do Show Fields - Prorated Service Start Date Text, Prorated Service Start Date, or Prorated Invoice to Follow.
Copy link to clipboard
Copied
- Remove the Mouse Down actions you added. You should only do it using a script.
- Set the drop-down field to commit the selected value immediately, under Properties - Options.
- There's an error in your code. The field name is just "Term of Agreement", not "Term of Agreement#1".
Copy link to clipboard
Copied
Thank You!!!
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more