How can I validate the fields?