Tabbing in a textarea?
Moderator: General Moderators
Tabbing in a textarea?
How do you make it to where when you press the "Tab" key in a textarea, it doesn't go to the next element in the page but rather have it really insert a tab?
- MarK (CZ)
- Forum Contributor
- Posts: 239
- Joined: Tue Apr 13, 2004 12:51 am
- Location: Prague (CZ) / Vienna (A)
- Contact:
Ok, here it is:
Code: Select all
<textarea id='tarea' onkeydown='if (event.keyCode == 9) {this.value += "\t"; return false;}'></textarea>-
nickvd
- DevNet Resident
- Posts: 1027
- Joined: Thu Mar 10, 2005 5:27 pm
- Location: Southern Ontario
- Contact:
Take a look at this page: http://weblogs.asp.net/skillet/archive/ ... 95838.aspx ... i didnt test it out, but it may be a start...
is IE6-only code, doesn't work in FF. But might be a start, indeedTake a look at this page: http://weblogs.asp.net/skillet/archive/ ... 95838.aspx ... i didnt test it out, but it may be a start
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
this article should help:
http://www.webreference.com/programming/javascript/ncz/
uses createTextRange() for IE
http://www.webreference.com/programming/javascript/ncz/
uses createTextRange() for IE
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
Moz and IE have different (both proprietary) systems when it comes to this.
This helped me when I needed it:
http://www.faqts.com/knowledge_base/vie ... /aid/13562
This helped me when I needed it:
http://www.faqts.com/knowledge_base/vie ... /aid/13562