Order management validation

Order management validation

Hi ,
          In our order management application  ,The Total field value Must be 100 ,when i submit a form If the Total value is  more than or less than 100 the  alert has to display  i.e  " Total should 100 "  ,
where can i write the validation  code in order management application  .

Please Help me out .

Thank you