Coder Profile - Show off your skills, get a coder profile.
 
 
 
The Author
VBAssassin
Scott Thompson
Send A Message
Screenshot
View Full Size
screenshot.png ( 0.00Mb )
Rating
9.00
out of 10
( 2 Ratings )
Please login to rate source codes.

Click here to register a free account with us.
General Details
JavaScript
Posted 118 Days Ago
430 Views
Received 2 Ratings
More Codes By This Author
Slime Wars Game v1
Pagination Class
Template Class (no evals...
Weighted Picking of URLs...
Easily make anything fade...
Articles By This Author
[PHP] - Lets kill the com...
How to use Memcache on Wi...
PHP Sessions = Member Dat...
Speed Up Delivery of your...
AJAX - When to use it?

Rich Text Editor (minimal & progressive enhancement)


Description
Will convert any textarea tag in to a richtext box. If no javascript is enabled, the plain textarea is used otherwise it converts it to a richtext box. On form submission the content in the richtext area is converted back to the textarea and the form is submitted as if there was no rich text box at all!

This is just a small framework, the minimal requirement to render a rich text box. It also works on Safari, Opera, FireFox and IE.

Kind regards,
Scott

P.S. i added a single line of PHP that will show the output of submitting the form.
Technical
To use, all you have to do to dynamically convert a textarea in to a richtext box is wrap any textarea tag with this:

<span rel='richtext' width='100%' style="cursor:text;">
<iframe class='richtext' style='display:none;'></iframe>
<TEXTAREA HERE>
</span>

For example:

<span rel='richtext' width='100%' style="cursor:text;">
<iframe class='richtext' style='display:none;'></iframe>
<textarea style='width:100%;height:200px;' name='sent'>hello<a>dsg hgdfjhgfhfda</textarea>
</span>

Theres no need to change any of your server side code because the content is sent normally within a forum tag using the textarea properties such as the field name! ;-) Put the default text you want in the richtext editor etc between the textarea tags as normal.
Source Code
Comments
Please login to post comments.
 
VBAssassin     Posted 90 Days Ago
 
 
Go ahead, do what ya want with it. As a thanks though, just leave a link back to
coder profile ;-)

Kind regards,
Scott
 
Binaries     Posted 90 Days Ago
 
 
Great work i've been looking for this so clients can easily change and update
pages, hope you don't mind me modifying and updating :).
 
FallingTears     Posted 98 Days Ago
 
 
That's just ... awesome. I love it.
 
Izzmo     Posted 117 Days Ago
 
 
Sweet. So, HTML works, awesome.
 
VBAssassin     Posted 117 Days Ago
 
 
On IE the bold, italic, underline, etc shortcuts auto work... but in that example i
was on firefox and i did that by putting default text in the textarea like:

<textarea>hello <b>mate</b>, how are you?</textarea>

Where "mate" would then be bold when the rich text editor loads.

Kind regards,
Scott
 
Izzmo     Posted 117 Days Ago
 
 
Very cool. I think I will add this to my 'employee portal' for my clients.

I see in the screen shot the text is bolded. Is this done by hot keys (Cntrl-B) ??

If so, that would be awesome.
Page 1 of 1
More "JavaScript" Source Codes By This Author
Recently Posted "JavaScript" Source Codes
Recently Rated "JavaScript" Source Codes
 
 
Latest News About Coder Profile
Coder Profile Poll
What is the next application you would like to be added to your profiles?

Books
Coding Challenges
Project Management
Blog
Tutorials


please login to cast your vote
and see the results of this poll
Latest Coder Profile Changes
Coder Profile was last updated
5 Days Ago
Official Blog :: Make A Donation :: Credits :: Contact Me
Terms & Conditions :: Privacy Policy :: Documents :: Wallpapers
Version 1.46.00
Copyright © 2007 - 2008, Scott Thompson, All Rights Reserved