Field Validation

Can you recommend the best way to add validation for additional fields.
ex. prevent confirming appointment if an additional field is over 50 characters.