www.webdeveloper.com
Results 1 to 3 of 3

Thread: Selection of tags problem

Hybrid View

  1. #1
    Join Date
    Jun 2008
    Posts
    223

    Selection of tags problem

    Hi, hope someone can help with this. I know a little JS, but not all that much.

    I use a Javascript HTML Editor for my blog and it works a treat, except for one aspect.

    I can select text in a textarea, but if tags are present a problem occurs.

    I can select these fine
    Code:
    before<br><br>After
    before
    After
    But if I select anything with tags this happens
    Code:
    <br><
    ><br>
    Is there a very simple bit of code which will overcome this for the entire textarea?

    At the top of the code is a variable, used throughout the code with conditions. I assume this "enables" the textarea.
    Code:
    var textarea;
    Perhaps it needs something?

    I tried:
    Code:
    var textarea(focus);
    But that didn't work.

  2. #2
    Join Date
    Jan 2005
    Posts
    369
    Does this editor have a name?
    I suspect that a proper fix will require modification of either a rather complicated RegExp, or of a similarly complicated tokeniser, so I doubt that
    var textarea
    will be relevant.

  3. #3
    Join Date
    Jun 2008
    Posts
    223
    After searching around I found out it is an IE problem. Doesn't happen in Chrome.

    So it looks like I'll have to leave it as is. Because, as you say, this could get quite complicated and lengthy, increasing the size of the editor code (Balakrishnan's little one) to larger than I want.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles