by Davo Smith.
This seems like a lot of hard work, not to mention it would have to be written in Javascript and would stop working if that was switched off.
Would it not be easier to just copy the username from the email at the point where the submitted form is processed?