SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Apr 2002
    Posts
    395
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Differentiating text in a textarea?

    I have a textarea where I have alot of name seperated by commas with no spaces, in a manner similar to this:

    name1,name2,name3,name4,name5,name6,name7,name8,name9
    etc.

    Because the names are so close to eachother with no spaces, it is often hard to find a name or distinquish one from the other.

    So, I was wondering it it was possible to make the text look different? For example, havethe commas a different color, such as red? Or to have the commas in a much larger font?
    Or to have every other name in bold?

    The name's list is pulled from a db and I cannot modify the db, the list must stay the same. So, I was wondering if there's a way to do it using css?

    I have posted about this in the CSS forum but they say CSS can't do the job so I'm hoping javascript can help me. Here's the thread in CSS forum - http://www.sitepoint.com/forums/showthread.php?t=264432

  2. #2
    SitePoint Guru
    Join Date
    Feb 2005
    Posts
    602
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's impossible to apply text formatting to segments of text in textareas. Your best bet is to take the data from the textarea, copy it to a div in whatever format and style you want, and hide the textarea.

  3. #3
    SitePoint Aficionado JVLB's Avatar
    Join Date
    Jan 2002
    Location
    N 44 56.537' W 123 3.683'
    Posts
    1,127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It would, however, be possible to introduce spaces after the commas using JavaScript.


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
  •