If an agreement is handwritten, it can still be 100% legal and enforceable by a court of law — with small exceptions.
A contract, regardless of whether it's handwritten or not, needs to tick the the following boxes: A) Mutually agreed by both parties, B) Have legal validity, C) Capacity, D) Consideration.
Regarding exceptions: due to the Statute of Frauds, certain contracts need to be written in order for them to be legally-binding: