adds form validiation for inputs and text field