textbox and the tab key

  • Thread starter Thread starter PJ6
  • Start date Start date
P

PJ6

What's the best way to prevent the tab key from shifting focus away from a
textbox, but rather insert the tab character? Do I just do it the obvious
way with JavaScript or is there some simple property to set?

Paul
 
PJ6 said:
What's the best way to prevent the tab key from shifting focus away from a
textbox, but rather insert the tab character? Do I just do it the obvious
way with JavaScript or is there some simple property to set?

Paul

I'd simply change the textbox to a "multiple line" textbox also known
as the textarea in HTML forms. You can have a textarea in same height
as a textbox so the design doesn't get crushed by it. The textarea
supports the tab character and you're done :)

-Kevin
 
Um... already have a multiple line textarea. Tab still alters focus. Is it
just an IE problem?

Paul
 
the <textarea> doesn't support tab entry (other than a paste). you can use
client script to do it though, through the onkeydown event. if the key is a
tab, insert the tab char into the current postion..

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top