This topic has been archived. It cannot be replied.
-
工作学习 / 专业技术讨论 / 各位大虾春节好,请问如何使TEXTAREA支持TAB键?
-walacato(ERIC);
2006-1-27
(#2749768@0)
-
大虾春节好, Shift+Tab
-canadiantire(轮胎-M.I.N.K.);
2006-1-27
(#2749789@0)
-
试过了,好象无反映啊!
-walacato(ERIC);
2006-1-30
(#2753036@0)
-
use JavaScript
-xanada(㊣流水);
2006-1-30
(#2753046@0)
-
How to ? Thanks...
-walacato(ERIC);
2006-1-30
(#2753173@0)
-
I don't understand ur question, TextArea automatecly support Tab key, could u tell us what result do u want to get?
-binghongcha76(一只大猫);
2006-1-30
(#2753388@0)
-
TEXTAREA中使用TAB时,会跳转到同页面中下一个对象,而不是在TEXTAREA中对应内容进格。如果按SHIFT+TAB,将会跳转到同一页面前一个对象。如果按CTRL+TAB会跳转到下一个FRAME。如何让其在TEXTAREA中进格?
-walacato(ERIC);
2006-1-31
(#2754441@0)
-
try onkeydown event<HTML>
<HEAD>
</HEAD>
<BODY>
<FORM>
TextArea tab test<BR><BR>
<TEXTAREA VALUE="" NAME="BOX_A" ROWS=15 COLS=39 onkeydown = "return handleTab(event)"></TEXTAREA>
</FORM>
<SCRIPT type="text/javascript">
function handleTab(evt)
{
var charCode = (evt.which) ? evt.which : event.keyCode;
if (charCode == 9)
{
document.forms[0].BOX_A.value += "\ x 0 9"; //remove the space when you try.
return false;
}
return true
}
</SCRIPT>
</BODY>
</HTML>
-guestagain(guest again);
2006-1-31
{504}
(#2754827@0)
-
Sorry, sir, it's my fault, ur codes works very well
-binghongcha76(一只大猫);
2006-1-31
(#2755032@0)
-
not really, this one is better
-guestagain(guest again);
2006-1-31
{726}
(#2755123@0)
-
Yeah, execellent, that is the best result I want, hehe, I forgot how to create TextRange, U r great, thanks
-binghongcha76(一只大猫);
2006-1-31
(#2755171@0)
-
非常感谢,但还有个问题,当通过鼠标选取了一个区域后,再按TAB键,就无法把这个区域内容一齐向后移动了,大虾有解决方案吗?
-walacato(ERIC);
2006-2-1
(#2756504@0)
-
No, buddy, U have to set the focus back to the TextArea, this is my version, still not very good, I think if we want to get the best result just like Win Form, we have to use TextRange and more JScript codes......
-binghongcha76(一只大猫);
2006-1-31
{973}
(#2754971@0)