Tab key inside div

Tab key inside div

am 19.12.2007 16:16:05 von rodchar

hey all,
is it possible to simulate the Tab key inside a Div element?

thanks,
rodchar

Re: Tab key inside div

am 19.12.2007 16:56:48 von mark

"rodchar" wrote in message
news:C87E75BD-3D4B-457C-8339-16308E4B31D4@microsoft.com...

> is it possible to simulate the Tab key inside a Div element?

Not sure what you mean...

The Tab key will set focus to the next editable element horizontally then
vertically - is this not what you want...?


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Re: Tab key inside div

am 19.12.2007 18:01:04 von rodchar

no, i mean tab over spaces.

"Mark Rae [MVP]" wrote:

> "rodchar" wrote in message
> news:C87E75BD-3D4B-457C-8339-16308E4B31D4@microsoft.com...
>
> > is it possible to simulate the Tab key inside a Div element?
>
> Not sure what you mean...
>
> The Tab key will set focus to the next editable element horizontally then
> vertically - is this not what you want...?
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net
>
>

Re: Tab key inside div

am 19.12.2007 18:52:29 von mark

"rodchar" wrote in message
news:31E88F91-D777-4D39-AFC1-E3CDF7B69866@microsoft.com...

>> "rodchar" wrote in message
>> news:C87E75BD-3D4B-457C-8339-16308E4B31D4@microsoft.com...
>>
>> > is it possible to simulate the Tab key inside a Div element?
>>
>> Not sure what you mean...
>>
>> The Tab key will set focus to the next editable element horizontally then
>> vertically - is this not what you want...?
>
> no, i mean tab over spaces.

Explain, please...


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

RE: Tab key inside div

am 20.12.2007 04:21:00 von MohamadElarabi

Not exactly an ASP.Net question but here is my response:

You can try placing a OnKeyPress or an OnKeyDown event on the div and have
them call a js function.

Your function should check the value of event.keyCode to see if tab was
pressed or not. I think the keycode for tab is 8 but I could be wrong. If it
is tab then append 4 or 8 spaces to the div's innerHTML/innerText etc then
make sure to return false and cancel event bubbling so the browser won't tab
to the next control.

Something like this





Hope that works for you.

--
Mohamad Elarabi
Lead Developer. MCTS, MCPD.


"rodchar" wrote:

> hey all,
> is it possible to simulate the Tab key inside a Div element?
>
> thanks,
> rodchar

RE: Tab key inside div

am 20.12.2007 20:01:03 von rodchar

thanks for the help everyone.
rod.

"Mohamad Elarabi" wrote:

> Not exactly an ASP.Net question but here is my response:
>
> You can try placing a OnKeyPress or an OnKeyDown event on the div and have
> them call a js function.
>
> Your function should check the value of event.keyCode to see if tab was
> pressed or not. I think the keycode for tab is 8 but I could be wrong. If it
> is tab then append 4 or 8 spaces to the div's innerHTML/innerText etc then
> make sure to return false and cancel event bubbling so the browser won't tab
> to the next control.
>
> Something like this
>
>


>
>
>
> Hope that works for you.
>
> --
> Mohamad Elarabi
> Lead Developer. MCTS, MCPD.
>
>
> "rodchar" wrote:
>
> > hey all,
> > is it possible to simulate the Tab key inside a Div element?
> >
> > thanks,
> > rodchar