Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2006
    Thanked 0 Times in 0 Posts

    adding strings of text to a textbox.

    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

  2. #2
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Bucharest, ROMANIA
    Thanked 379 Times in 375 Posts
    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.
    Offshore programming


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts