Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to apply css style to particular words in text area

 
Sujatha Kalluri
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • 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
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • 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".
 
Shinelin Samuel
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • 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
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thank you for your suggestions. I will look for RTE option.

Sujatha.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic