tags:

views:

393

answers:

3

Can anybody suggest the best way of keeping the formatting intact of a text field - ie. keeping the line breaks or carriage returns in mysql and then recognising them when the form is populated on login?

Currently when the textfield data is stored (in a TEXT field in mysql) its losing the carriage return values and adding a small square box instead.

Would it be a case of formatting with nl2br or using a str_replace instead?

Thanks

A: 

The square box is likely just not having the character set to show the paragraph marker (¶) that MySQL wants to show in place of carriage returns.

You should be able to pull the data back out of MySQL into a textarea to confirm that the data is being stored properly.

great_llama
A: 

This is not a jQuery issue. The $_POST should come with the correct breaks included.

Elzo Valugi
A: 

I solved my own problem. It wasn't a jQuery issue but I wasn't addressing the posted variable in the correct way.

Choog
what did I say?
Elzo Valugi