View Full Version : adding strings of text to a textbox.

Michael B
07-27-2006, 01:38 PM
I have this textbox (yes I said textbox not textarea, xul is what I am useing). And I what to add a small bit of text in the middle of a lot of code. What I am useing is selectionStart to cut the value of the textbox in two the doing

textbox.value = firstBlock + newText + LastBlock

But I am finding were this is a lot of text in the textbox this can be slow. Is there a better way of doing this that dose not reguire the value of all the text to be colected and the printed back out again?

Yours respectfully
A JavaScript Newbe

07-27-2006, 01:51 PM
Anything else you might do (using string methods or RegExp), in the final you will have to give your textfield the new value, so that, no, I guess that there is no other way without printing the new value back again in the field.