It sounds like you are displaying text that already exists, rather than typing text into the textarea.
If all tab characters are at the beginning of the line (for indenting purposes) then you can use this code to replace tab characters with 4 spaces: