日期:2014-05-16  浏览次数:20385 次

textarea里面如何检测到回车事件?
textarea里面如何检测到回车事件?

------解决方案--------------------
用flex可以实现
JScript code

<mx:application xmlns:mx="http://www.adobe.com/2006/mxml">
layout="vertical"
verticalAlign="middle"
backgroundColor="white"&gt;</mx:application>
 
<mx:script>
<!--[CDATA[
private function textArea_textInput(evt:TextEvent):void {
if (evt.text == "\n") {
evt.preventDefault();
}
}
]]-->
</mx:script>
 
<mx:textarea id="textArea">
verticalScrollPolicy="on"
width="160"
height="120"
textInput="textArea_textInput(event);"&gt;
<mx:text>The quick brown fox jumped over the lazy dog.</mx:text>
</mx:textarea>

------解决方案--------------------
http://www.nowamagic.net/javascript/js_GetBlankAndEnterInTextarea.php
------解决方案--------------------
function EnterClick() {
var code = document.all ? window.event.keyCode : arguments.callee.caller.arguments[0].which;
if (code == "13") //enter键
{

////
}
};
------解决方案--------------------
http://www.nokiamobile.org.cn/29_090810_1490012.html