How to ignore textbox control focus while using TAB.
-
I want to ignore a TextBox Control from getting focus() while pressing TAB key. I know there's no property Tabstop for TextBox control in asp.net. I want to know how to do it in JavaScript. Regards Asif Rehman
-
I want to ignore a TextBox Control from getting focus() while pressing TAB key. I know there's no property Tabstop for TextBox control in asp.net. I want to know how to do it in JavaScript. Regards Asif Rehman
Asif Rehman wrote:
I know there's no property Tabstop for TextBox control in asp.net
Yes there is no property for this.
Asif Rehman wrote:
I want to know how to do it in JavaScript.
There is no need for this. Set the
TabIndex
property of the textbox as-1
.Now while pressing the tab, focus wont come on the textbox.Cheers!! Brij Visit my Blog: http://brijbhushan.net
Check my latest Article :Client Templating with jQuery -
I want to ignore a TextBox Control from getting focus() while pressing TAB key. I know there's no property Tabstop for TextBox control in asp.net. I want to know how to do it in JavaScript. Regards Asif Rehman
Have a look on this http://bytes.com/topic/c-sharp/answers/275037-disable-tab-key You don't want to move a focus to specific control? For some reason, you don't want to some control receive a focus. That could be a case if, for example you have an invisible text box or some search text box on top of the web page, but you want to allow tab functionality only to few main controls on the web form. Simply set TabIndex property of server control, or tabindex attribute of HTML control to -1. When you run web page and hit tab key, controls with TabIndex = -1 will never get a focus. Although, user can click into this control with a mouse and set focus on that way.