Google Chrome textareas包装和添加换行符 [英] Google Chrome textareas wrapping and adding line breaks

查看:174
本文介绍了Google Chrome textareas包装和添加换行符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Google Chrome中遇到了textarea的问题。我使用的是经典的ASP,但这并不重要,因为Chrome实际上是在错误地发布数据。



问题在于文本区域。只要文本字符串太长而不能适应文本区域的一行,就会绕到下一行(因为它应该)。



我的问题是当提交时,表单数据包含CarriageReturn& LineFeed在文本包装的每个地方,以及用户生成的输入/返回事件 - 我甚至无法区分这两者之间的区别。



有谁知道解决这个问题?可能在文本区域的选项或东西?所有其他浏览器只添加CarriageReturns和LineFeeds,最终用户实际上已将其放入。 解决方案

textarea上的 wrap =hard属性。



您是否设置了 wrap =hard textarea?如果是这样,请将其删除。如果没有,你可以尝试设置 wrap =soft作为属性吗?


I've got a problem with textarea's in Google Chrome. I'm using classic ASP, but this is unimportant as Chrome is actually posting the data incorrectly.

The problem is with a text area. As soon as a string of text is too long to fit one line of the text area, it wraps to the next line (as it should).

My problem is that when submitted, the form data contains a CarriageReturn & LineFeed at every spot where the text wrapped, as well as user generated enter/return events - I can't even tell the difference between the two.

Does anyone know how to fix this? Possibly an option in the text area or something? All other browsers only add CarriageReturns and LineFeeds where the end user has actually put them in.

解决方案

This should only happen if you set the wrap="hard" attribute on the textarea.

Do you have wrap="hard" set on the textarea ? If so, remove it. If not, can you try setting wrap="soft" as attribute?

这篇关于Google Chrome textareas包装和添加换行符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆