Hybrid View
-
20 Oct 2007 10:30 AM #1
How to setup tabindex for form fields
How to setup tabindex for form fields
Hi ,
could you please let me know, how I can set tab index for form fields for auto-focus?
thanks in advance for your help,
-
20 Oct 2007 10:37 AM #2
-
20 Oct 2007 11:30 AM #3
Hi Animal,
I tried that but no use, I am not able to identify, where the focus is going after username, after pressing tab 3 times then only am able to focus into password field. Also may I know how can I set autofocus to username field ?HTML Code:items: [{ fieldLabel: 'User Name', name: 'username', width:125, allowBlank:false, tabIndex:1 },{ fieldLabel: 'Password', inputType:'password', name: 'pwd', allowBlank:false, width:125, tabIndex:2 } ]
Thanks in Advance for help,
-
20 Oct 2007 12:55 PM #4
I don't understand, can you post an example page which will drop into the examples/* directory?
-
20 Oct 2007 5:20 PM #5
Hi Animal,
I attached the zip folder which is having 3 files view1.html, FeedViewer1.js FeedPanel1.js could you please check by placing examples/feedviewer folder. Just try for navigation from username to password field using tab.
Thanks in advance for your valuable time and help.
-
20 Oct 2007 9:20 PM #6
hi, Venkateswara Rao, my code:
Code:var tn = 1; 。。。 fldName = new Ext.form.TextField( { fieldLabel : '值', id : 'option-name', tabIndex : tn++ }); fldName.on('specialkey', onEnter); fldDescrip = new Ext.form.TextField( { fieldLabel : '名称', id : 'option-descrip', tabIndex : tn++ }); fldDescrip.on('specialkey', onEnter); formPanel = new Ext.FormPanel( { border : false, labelWidth : 70, labelPad : 5, bodyStyle : 'padding: 20px 50px', frame : false, items : [fldName, fldDescrip] }); 。。。 function initFocus() { var f = Ext.get(adding ? 'option-name' : 'option-descrip'); f.focus.defer(100, f); } //User can press Enter or Tab Key to navigate function onEnter(elem, e) { if (e.getKey() === e.ENTER) { var f = formPanel.form.items.itemAt(this.tabIndex); if (f && !f.disabled) { f.focus(); } else { if (adding) <---------------- navigate to button okBtn.focus(); else okHideBtn.focus(); } e.stopEvent(); } }
-
2 Dec 2012 10:00 PM #7


Reply With Quote
