Can you attach a copy of that page so I can see what might be wrong? I'm not sure that I understand your description of the problem either.
Are you saying it works fine if the security code is entered correctly the first time, but if you enter the wrong security code then some fields are cleared?