It was written just after he lost his memory to a backfiring Memory Charm, even though he was only just able to do joined up handwriting three years later. It's possible that the book was dictated to (or perhaps even ghostwritten by) someone else.
Behind the scenes
- The book was shown in the window of Flourish and Blotts at the end of the credits in the film adaptation of Harry Potter and the Chamber of Secrets, though it wasn't mentioned in the book.
- The picture of Lockhart on the book's cover can be heard humming "Hedwig's Theme."
- Since the Memory Charm that backfired effectively wiped Lockhart's memories of who he was, yet amnesia does not affect such things as speech, one's ability to write or for example tie a shoe due to it being a 'different kind of memory', it is possible that Lockhart could indeed write immediately after losing his memory, but that the spell left him permanently forgetful and he repeatedly forgot that he knew how and boasted about having learned it later. Alternatively, he just likes to boast and being able to write understandably sufficed for him to boast of in the absence of a more impressive feat.
- Harry Potter and the Chamber of Secrets (film) (First appearance)