Trim text for text boxes

Refs #10441