It's because you are setting the value of the form field as just that one character as you loop the length of the string, so the last letter is the only ASCII code that will appear.
document.thisForm.clearText.value [COLOR="Red"]+[/COLOR]= someString.charCodeAt(j);
This is shorthand for "field value equals itself plus additional data".
(Och! Fang beat me to it!)