• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to apply css style to particular words in text area

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a jsp page in which textarea element is popoulated with data from request parameter. I want to make some of the words in the text area bold and italics, how do I apply css to selective words inside textarea. or can I make those words bold , italics in java itself before sending to jsp? I googled it but no solution.



thanks in advance,
Sk
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You would be better off using an existing solution rather than recreating it on your own. You could try something (but not limited to) this. There are tons out there. Just Google for "html rich text editor".
 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
You can achieve this by including(hard code) the corresponding HTML tags between the text. (guess that you might have tried this)
To my knowledege, you cannot associate a CSS style in this case, as css style need to be attached to a HTML component tag.

Gregg's link will definitely help you.

Thanks,
Shinelin
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since no one said it yet, It is impossible to style portions of a textarea differently. If you apply a style, it has to apply to everything in that element. You would have to look at at RTE as Gregg mentioned. There are plenty of options out there.

Eric
 
Sujatha Kalluri
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for your suggestions. I will look for RTE option.

Sujatha.
 
reply
    Bookmark Topic Watch Topic
  • New Topic