Expand my Community achievements bar.

JS for subforms

Avatar

Former Community Member
I want to change the presence attribute of a subform that is currently hidden to visible based on a the larger value of two fields. This is what I have so far in the Exit event of curAmtRequested field:



ProjectCost = F.ProjectDurationAndCosts.ProjectCosts.curTotProjCost.value;

AmtRequested =F.ProjectDurationAndCosts.ProjectCosts.curAmtRequested.value;



if( AmtRequested < ProjectCost)

{

F.ProjectDurationAndCosts.CostAndProjectSummary.presence = "visible"; xfa.host.setFocus("xfa.form.F.ProjectDurationAndCosts.CostAndProjectSummary.txtComment");



}

else

{

F.ProjectDurationAndCosts.CostAndProjectSummary.presence = "Hidden";

xfa.host.setFocus("xfa.form.F.ContactInfo.AuthorizingOfficial.txtAuthOfficialPrefix");

}



Any suggestions as to why it doesn't work & how to fix it?
0 Replies