check if input value only contains whitespace before saving

refers to #1851