Welcome Guest, Not a member yet? Register   Sign In
CI its saving double nl into the database
#1

[eluser]JuanitoDelCielo[/eluser]
I want to save the content of one textarea into the database.
Code:
//Simple validation
$this->form_validation->set_rules('description', 'DescripciĆ³n', 'required');
$classified->description = $this->input->post('description');
$this->db->insert('classifieds', $classified);

There is not any extra data manipulation and it always add a double nl

I want to save

1
2

3
4

but the result its

1

2


3

4

Any ideas or function to avoid this?
#2

[eluser]WanWizard[/eluser]
Check in the logs if the URL isn't requested twice after a submit, for example because of a missing asset on the page (in some browsers, with certain rewrite rules, even a missing favicon.ico can trigger a second request).
#3

[eluser]bubbafoley[/eluser]
I've seen this before. Does this fix it?

https://bitbucket.org/ellislab/codeignit...584c431c64
#4

[eluser]JuanitoDelCielo[/eluser]
I double check that WanWizard

Actually I isolate the code and the errors stills there.
#5

[eluser]JuanitoDelCielo[/eluser]
bubbafoley Now it works OK ty so much guys!
#6

[eluser]WanWizard[/eluser]
If that bug causes a double insert on the post of a textarea, I wonder what you're code looks like.
One post = one form = one set of fields = one insert... In this sequence, the contents of the form fields is irrelevant.
#7

[eluser]Phil Sturgeon[/eluser]
WanWizard: Did you look at the commit? Some how, some people in some browsers are getting line endings as \r\n\n which gets really screwed up when it is displayed, and turns into two new lines.

God knows how... I think it was happening in PyroCMS due to use using CodeMirror (JS highlighting in a text area) but not sure how this is happening for other people.
#8

[eluser]JuanitoDelCielo[/eluser]
Yeap Firefox in MacOS works fine, Firefox Windows fail :S




Theme © iAndrew 2016 - Forum software by © MyBB