1

Topic: spaces being dropped after textarea wordwrap (new user)

Hello – (this may be a bug or my inexperience)

When initialising a textarea of width 70 columns with a piece of text about 180 char long, the last space before the end of the wrapped line gets dropped when the edited (or even unedited) text is posted to the PHP processing script. So for example XYZ (UK) Ltd gets changed to XYZ(UK) Ltd
I tried setting

preformatted : "true",

but that made no difference, and can't see anything in the Tips forum.

Any help much appreciated!

TinyMCE version info (1.4.3?) * $RCSfile: tiny_mce_src.js,v $ * $Revision: 1.168 $ * $Date: 2005/03/06 20:51:43 $
Firefox info – 1.0.1
OS info – OS 10.3.6

David S

2

Re: spaces being dropped after textarea wordwrap (new user)

It seems that the textarea variable was being posted by tinyMCE with some control characters inserted to provide  a soft word-wrap. The following php code fixed the problem:

$text = $HTTP_POST_VARS['newtext'] ; // get textarea content
$text = ereg_replace('[[:cntrl:]]'," ",$text) ; // convert control chars
$text = str_replace('  '," ",$text) ; //strip double spaces

David S

3

Re: spaces being dropped after textarea wordwrap (new user)

Having a similar problem with end of line-wrap spaces dissapearing...

Well that fixed it !

yikes

Chris
[Paris - France]

4

Re: spaces being dropped after textarea wordwrap (new user)

i've tried this but i'm still getting spaces dropped...but only in firefox, not IE...and these are not associated with word-wrapping or linefeeds. is there some IE-specific code causing this?

5

Re: spaces being dropped after textarea wordwrap (new user)

oops, nevermind: an onsubmit javascript error was causing the string replacements not to happen...an error that ie silently ignores...