Expand my Community achievements bar.

Contract End date should not less than Start date, else CLEAR it

Avatar

Level 8

Hello

I put CONTRACT START DATE and CONTRACT END DATE fields on the form. These 2 objects (Date/Time objjects) i pulled them from Satndard tab of pallette and dropped on my layout page design, fine.

Now, am trying to put a validation that the end dat eshould not lower than start date, so, i got a thread as below from Niall,

http://forums.adobe.com/message/1909551

and i did my FormCalc coding under EXIT event of END DATE field as below,

// Pls. note this FormCalc
// End date should not less than Start date, else CLEAR it - Begin

var stDate
var endDate

stDate = xfa.resolveNode("CUSTOMER.Page31_Contracts.Con_Whole_Page.CON_Basic_Info.CON_START_DATE").rawValue
endDate = xfa.resolveNode("CUSTOMER.Page31_Contracts.Con_Whole_Page.CON_Basic_Info.CON_END_DATE").rawValue

if (stDate > endDate) then
    xfa.host.messageBox("End date is lower than Start date! End date is cleared")
    xfa.resolveNode("CUSTOMER.Page31_Contracts.Con_Whole_Page.CON_Basic_Info.CON_END_DATE").rawValue = null
endif

// End date should not less than Start date, else CLEAR it - End

I tried in VALIDATE, CALCULATE, CHANGE events of END DATE, but nothing working!!

PLs. let me kow how can i achieve my requirement? I am anewbie,

Thank you

1 Reply