aboutsummaryrefslogtreecommitdiff
path: root/content/blog/2008-10-11-tabbing-through-fields-vertically.markdown
diff options
context:
space:
mode:
authorJulio Capote <jcapote@gmail.com>2023-01-24 03:20:47 +0000
committerJulio Capote <jcapote@gmail.com>2023-01-24 03:20:47 +0000
commitf24f2d15275961f1c0144e68fde75a60aeaaa165 (patch)
tree38be1626f3ade436fbd17eadb2753fa2f0effb37 /content/blog/2008-10-11-tabbing-through-fields-vertically.markdown
parentbf04383b34c4a4fdfe239de2805a30a051921002 (diff)
downloadcapotej.com-f24f2d15275961f1c0144e68fde75a60aeaaa165.tar.gz
move to bear theme
Diffstat (limited to 'content/blog/2008-10-11-tabbing-through-fields-vertically.markdown')
-rw-r--r--content/blog/2008-10-11-tabbing-through-fields-vertically.markdown27
1 files changed, 27 insertions, 0 deletions
diff --git a/content/blog/2008-10-11-tabbing-through-fields-vertically.markdown b/content/blog/2008-10-11-tabbing-through-fields-vertically.markdown
new file mode 100644
index 0000000..c27c10b
--- /dev/null
+++ b/content/blog/2008-10-11-tabbing-through-fields-vertically.markdown
@@ -0,0 +1,27 @@
+---
+title: "Tabbing through fields vertically"
+date: 2008-10-11T01:54:00Z
+comments: false
+url: /post/54058512/tabbing-through-fields-vertically
+tags:
+---
+
+
+
+Sometimes it’s useful to switch the browser’s default tabbing behavior (left to right) to the opposite (top to bottom) when your input fields are in a grid layout instead the of the usual single column layout. Having to do this manually is a real pain, especially for large grids; So here is a solution in javascript, using mootools:
+
+<!--more-->
+
+```javascript
+window.addEvent('domready', function(){
+ var trs = $$('#mytable tr')
+ var accum = 0
+ trs.each(function(tr, trindex){
+ accum = trindex + 1
+ tr.getChildren().each(function(td, tdindex){
+ td.getChildren('input')[0].tabIndex = accum
+ accum = accum + trs.length
+ })
+ })
+})
+```