SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    highlighting in textboxes

    I'd like to highlight the nth and nth+1 character of a textarea.
    Any suggestions on the syntax?
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if

  2. #2
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not in a regular textarea, as they don't display rendered HTML. You'd need to use something with contentEditable enabled.
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  3. #3
    SitePoint Member
    Join Date
    Mar 2003
    Location
    Urbana, MD
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    do you mean highlighti or SELECT the characters?

  4. #4
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Either. I have a loop that checks 3 characters in a textarea, 2 numbers and a comma.(00,01,02).
    I want to be able to let the client know at which point the loop is reading the textarea, if poss.

    any suggestions?
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if

  5. #5
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can do that with TextRanges

    http://msdn.microsoft.com/workshop/a...etextrange.asp
    http://msdn.microsoft.com/workshop/a..._textrange.asp

    I'll let you have a stab at it first
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  6. #6
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the pointer Beetle

    doing a grand job with it so far. Working, but a few problems to sort out (selects all on first function, and I have two textareas that I want to change at the same time) I'll keep going......
    Nice links......cheers
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if


Bookmarks

Posting Permissions

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