Validate data in form before making post