Validation logic on form inputs before persisting data