Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

Simple Message Box using IF Statement

Avatar

Level 2
I would like to know how to write the following correctly:



If(SF1.numFld1) doesn't equal (SF2.numFld2), then a messageBox would popup on docClose stating "numbFld1 doesn't equal numFld2".



I have used ($host.messageBox("Ensure numFld1 equals numFld2") as onClick and it worked fine but the aforementioned is beyond me at this time. Any help would be greatly appreciated.



I am currently using LiveCycle Designer 8.0.



Thanks!
2 Replies

Avatar

Level 5
FormCalc Code:

if (SF1.numFld1.rawValue <> SF2.numFld2.rawValue) then

xfa.host.messageBox("Ensure numFld1 equals numFld2")

endif



JavaScript Code:

if (SF1.numFld1.rawValue != SF2.numFld2.rawValue) {

xfa.host.messageBox("Ensure numFld1 equals numFld2");

}



use one of the code segments in appropriate event you would like. Using in 'docClose' event still may work but just gives you popup message but closes the document any way.



Good Luck,

SekharN.