1 Reply Latest reply: Mar 16, 2012 7:13 PM by dohanlon RSS

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

    srinivas1506 Community Member

      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").r awValue

      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").r awValue = 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