Welcome Guest, Not a member yet? Register   Sign In
textarea duplicates line breaks
#1

[eluser]Unknown[/eluser]
Hi!

I started a new project on CI 2.0 and I made a simple form which contains a textarea and a submit button. When I submit the form the CI duplicates every line breaks of the textarea.

Here's my view file:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

&lt;html &gt;

&lt;head&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
    &lt;title&gt;title&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;
    &lt;form action="http://localhost/test/test" method="post" accept-charset="utf-8"&gt;
        &lt;textarea rows="10" cols="50" id="text" name="text" class="text"&gt;&lt;?php echo $text; ?&gt;&lt;/textarea&gt;
        &lt;input type="submit" name="submit" value="submit" class="" /&gt;
    &lt;/form&gt;
&lt;/body&gt;


In the controller I just simply use var_dump to display the submitted result and I send back the text to the view file:

Code:
echo "<pre>";
var_dump($_POST['text']);
echo "</pre>";

$this->data['text'] = $_POST['text'];
$this->load->view('test', $this->data);

I write "a[enter]b" in the textarea and this is the var_dump result after the first submit (a plus empty line created between the two characters):
Code:
string 'a


b' (length=5)


When I submit the form once again the distance increses between the two character. I get this:
Code:
string 'a





b' (length=8)


First 1 empty line inserted, but later 3, 7, 15, 31 (and so on...) created after every line breaks.
This happens on CI 2.0.0. but this exact code perfectly works on CI 1.7.3. (I use Win7 and WampServer.)
Is this a bug? What should I do now to fix this?


Messages In This Thread
textarea duplicates line breaks - by El Forum - 02-03-2011, 04:59 AM
textarea duplicates line breaks - by El Forum - 02-09-2011, 09:11 AM
textarea duplicates line breaks - by El Forum - 02-10-2011, 03:17 AM
textarea duplicates line breaks - by El Forum - 02-21-2011, 02:38 PM
textarea duplicates line breaks - by El Forum - 02-22-2011, 12:50 AM
textarea duplicates line breaks - by El Forum - 03-07-2011, 02:44 AM
textarea duplicates line breaks - by El Forum - 03-22-2011, 12:04 AM
textarea duplicates line breaks - by El Forum - 04-06-2011, 11:33 AM
textarea duplicates line breaks - by El Forum - 04-06-2011, 01:08 PM
textarea duplicates line breaks - by El Forum - 04-07-2011, 12:08 AM
textarea duplicates line breaks - by El Forum - 04-07-2011, 01:13 AM
textarea duplicates line breaks - by El Forum - 04-10-2011, 03:08 PM



Theme © iAndrew 2016 - Forum software by © MyBB