Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can i use diferent text styles in a textarea object?

Status
Not open for further replies.

mae

Programmer
Apr 7, 2000
6
0
0
ES
How can i write words in a textarea with diferent styles, i mean, bold, italic, diferent sizes. It's posible with javascript?. Can i do that in IE and NT? <br>I want to add diferent buttons to the form, so when a user push a button with the bold label (for example) he writes in the textarea with bold, and that's way&nbsp;&nbsp;with diferent options to write.<br>
 
The closest you can get right now is to use CSS stylesheet options to control the text appearance of the WHOLE text box for version 4+ browsers. This works more completely in IE5 than in the other browsers. I don't think there is any way to control the appearance of individual selections of text inside the box, though. It's all or nothing.<br><br>The good news is CSS styles can easily be controlled with button clicks. Dreamweaver has excellent support for this in the Change Property behavior.
 
rycamor is right. you can change the appearance of the text in the textarea as a whole, but not a piece at a time. <p>theEclipse<br><a href=mailto:eclipse_web@hotmail.com>eclipse_web@hotmail.com</a><br><a href=robacarp.webjump.com>robacarp.webjump.com</a><br>**-Trying to build a documentation of a Javascript DOM, crossbrowser, of course. E-mail me if you know of any little known events and/or methods, etc.
 
well, if i can´t change a piece of the textarea, how can i simulate a little word process in a site?. I want implement, on my page, a little box to the user can write a text using bold, italic, and two diferent text sizes and then that text is saved in a database and i don´t want the user has to use the labels like 'b', 'i' and so on. How can do that? Please is important<b>!</b>
 
thank's is helpful, but this example doesn´t work in NS, and i need work in both navigators. do you know another site that have demos about this, working in IE and NS??
 
Your best bet might be to look for a Java applet that can do rich text. I will look, but please let me know if you find one, because I would find it interesting.<br><br>Another more difficult way would be to use a DHTML layer and capture key behaviors with Javascript, then write HTML into the layer, but that seems like going to Jupiter to get to the moon.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top