开发者

IE 7 textarea breaks between words

开发者 https://www.devze.com 2022-12-13 10:54 出处:网络
I\'ve got a LAMP site with a form that a user fills out. For some reason if viewing the returned form submission data on IE 7, it\'s inserting line breaks between each word. It\'s a pretty basic form

I've got a LAMP site with a form that a user fills out. For some reason if viewing the returned form submission data on IE 7, it's inserting line breaks between each word. It's a pretty basic form with some input elements and a text area. If I submit the form with FF3+, IE8, or safari this isn't happening and everything looks fine. If a user submits the form with IE7, 开发者_运维问答instead of "This is a description" I'm getting:

This

is

a

description.

I ajax submit the form data, then clean it up like so:

$description = mysql_real_escape_string(ucfirst($_POST['description']));
$description = stripslashes(trim($description));

Then update the table and display it with:

$description = stripslashes($description_data->description);.

The data in the table looks fine, no <br /> or \n tags to be seen. If I view the source, there are no breaks either, which really doesn't make sense.

I'm quite puzzled about this, and I'm not sure what else to try. Can anyone offer some guidance? Much thanks.


May be \r ? how about trying $description=str_replace("\r","",$description); ?


If the data in the database is ok, then the problem is the css or html code, not ajax.

0

精彩评论

暂无评论...
验证码 换一张
取 消