Validate form elements