Check if a move is valid to avoid form resubmission.