You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jim Collings <jl...@gmail.com> on 2009/06/25 21:33:51 UTC

Prevent Word formatting

I don't want users pasting in formatting from Word into my Struts II
text area. How can I prevent this?


Jim C.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Prevent Word formatting

Posted by Dan Slack <ds...@langui.com>.
If you want to allow pasting, but just strip out the word formatting, well,
that can be a pain, and the easiest solution is to use javascript.

I've used a library called CleanPaste
(http://antscode.blogspot.com/2009/05/strip-formatting-on-paste-using-yui.ht
ml), however, this is tied to the YUI Rich Text Editor.  I'd imagine there
are other "clean pastes" out there for non-YUI users..

If you want to disable pasting entirely, you can do some javascript keycode
checking for ctrl-v (although this is NOT fullproof).

Dan Slack

-----Original Message-----
From: Jim Collings [mailto:jlistnews@gmail.com] 
Sent: Thursday, June 25, 2009 2:34 PM
To: Struts Users Mailing List
Subject: Prevent Word formatting

I don't want users pasting in formatting from Word into my Struts II
text area. How can I prevent this?


Jim C.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Prevent Word formatting

Posted by Dave Newton <ne...@yahoo.com>.
Jim Collings wrote:
> I don't want users pasting in formatting from Word into my Struts II
> text area. How can I prevent this?

Don't allow them to paste?

You'd have to filter via JavaScript or on the server side.

Dave

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org