Check if form data is valid