Friday, June 25, 2010

textarea, max_length and \r\n

Hi all

I created a form with a textarea that has a max_length of 1024, this
textarea is rendered in frontend with a Javascript character counter,
what is odd is that the counter was giving the right length, in this
case 1024 and the form was failing in the max_length... debugging I
came to see that the Form is receiving the \n as \r\n in the POST data
for it.
So the length if failing cause '\r\n' counts as 2 intead of 1.

Searching on the internet I found out that it seems that the textarea
sends \r\n instead of \n. Is there any way to deal with this in
Django?

For now I will remove the max_length and make my own clean method for
this case.

Regards

Esteban

--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate