On 6/7/06, Eric Stadtherr estadtherr@gmail.com wrote:
The other issue I'm trying to solve is more of a browser/client issue. If a user has typed a message using the HTML editor, and then uses the toggle button to switch to the plain text editor, it would be ideal if this same HTML->Text rendering were performed. However, the PHP solution is a "back end" solution that would require another trip to the server.
I see three options: empty the text field when switching editor types (users will be mad) re-post the page when switching editor types, so the PHP HTML->Text or Text->HTML can be done on the server (slow and kind of an interruption) do the conversion in JavaScript in the browser (TinyMCE doesn't do this, so we'd have to find a JavaScript implementation of an HTML->Text renderer)
Any thoughts or other options? If #2 is the choice, I'd also like to ask for suggestions as to the best way to implement it.
A robust Javascript implementation would definitely be nice from the user PoV. Another option which is in between the two you have mentioned is to use AJAX principles - use Javascript to send the HTML to the backend and receive the plain text back. So still a server post/fetch but there is no full page reload involved and it is more seamless for the user.
Cheers Derek