Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

'Validate Failed' error message

Avatar

Former Community Member
Hi,



I've have a table in a dynamic form that contains four rows and a FooterRow that is to total the numeric values enterd in the 4 rows.



The following FormCalc code is in the calculate procedure of the footer row...

Sum(Table8g2.Row1.Col2 + Table8g2.Row2.Col2 + Table8g2.Row3.Col3 + Table8g2.Row4.Col4)



This is working correctly.



In the validate procedure for the footer row I need to compare the total with a value that has been entered elsewhere in the form. If it is not within 5% then a warning text box is displayed.



The FormCalc code in the validate procedure is...



lblAreaWarning.presence = "hidden"



var Val1 = Data.Sec8.Table8g2.FooterRow.TotalArea.rawValue

var Val2 = Data.Sec4.dblQ4aArea.rawValue



If (Val1 > 0 and Val2 > 0) then

var Diff = Abs(Val1 - Val2)

Diff = Diff / Val2

Diff = Diff * 100



if (Diff > 5) then

lblAreaWarning.presence = "visible"

endif

endif



I am getting a "TotalArea (field name) Validate failed" error message everytime this procedure is executed. The validation executes correctly with the label being displayed when required but the 'validate failed' message box is always popping up.



I notice several other people have has 'validate failed' errors but no responses have been posted. Does anybody know what is wrong with my code or what can I do to get rid of this error message.



Thanks for any help.



Chris
1 Reply

Avatar

Former Community Member
Hi,



I've placed a sample form on the web that can be founf at

http://www.users.on.net/~cbprescott/ValidateFailedTest.pdf



This form demonstrates the 'Validate failed' error that I am getting using both FormCalc and JavaScript.



The calculations in both are correct but the warning label is not being displayed when it should be.



Anyway have a look at the form and PLEASE let me know where I am going wrong. I've spent hours and hours trying to solve this but have failed miserabley.



Thanks for any help,



Chris