ok thanks!
i looked on the textwrapper api, but i didn't find a function
to replace the line breaks which are set by browser...
there are difference in line breaks between the browser?
if there are - there will be never a solution given to solve this
problem by
setting \n for line breaks which set in textareas...is that right?

If there are a function to set \n for textarea linebreaks, it would be
great!


On 2 Feb., 19:48, "Waylan Limberg" <[EMAIL PROTECTED]> wrote:
> On 2/2/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
>
> > The reason for my question is following:
>
> > i would like to use atextareawhich size is fix (rows/cols).
> > The text who everybody write into, should not be longer as the given
> > size of area.
> > So...if the line ends, the text should break automaticly in the next
> > line.
> > And this line break should allready exist in text which i set to
> > database.
>
> Ahh, that would be a browser feature as you're talking about the
> behavior of thetextareain the browser. From the server we don't have
> any control over what the browser does (and different browsers may act
> differently), except, of course, with javascript. Perhaps you could
> write some javascript to get the browser to behave as you want. But
> remember that some users may have javascript turned off. And CSS isn't
> going to work in atextareafor linebreaks - well, it may cause the
> data to display correctly, but it won't alter the submitted data.
>
> So the only real solution is to accept the data in whatever format it
> comes, validate it (and possibly reformat it) on the server before
> saving to the db. I'd suggest overriding the save method and using the
> textwrap module to reformat the text before saving.
>
>
>
>
>
> > On 2 Feb., 12:25, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
> > > On 02-Feb-07, at 4:26 PM, Simon Brunning wrote:
>
> > > >> field's value on the server side, post-submittal. I do that with one
> > > >> of my own forms (in order to fit the text in a box in a pdf).
>
> > > > Why write your own?
>
> > > > <http://docs.python.org/lib/module-textwrap.html>
>
> > > hey cool - just what i wanted at the instant i wanted it
>
> > > --
>
> > > regards
> > > kghttp://lawgon.livejournal.comhttp://nrcfosshelpline.in/web/
>
> --
> ----
> Waylan Limberg
> [EMAIL PROTECTED]


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to