Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Why is the cursor not going to the next checkbox if I press Tab

Reply
Thread Tools

Why is the cursor not going to the next checkbox if I press Tab

 
 
Stefan Mueller
Guest
Posts: n/a
 
      03-01-2006
If I click on the first image (mypic1.gif) and then press once theTab key
the focus is not going to the next checkbox within Internet Explorer. With
Mozilla Firefox it's working already the first time.

<html>
<body>
<img src= 'mypic1.gif' tabindex = '0'>
<input type = 'checkbox'>
<p>
<img src= 'mypic2.gif' tabindex = '0'>
<input type = 'checkbox'>
</body>
</html>

Is there any possibility to tell Internet Exporer also to jump to the next
checkbox if the Tab key is pressed only once?

Stefan


 
Reply With Quote
 
 
 
 
Blinky the Shark
Guest
Posts: n/a
 
      03-01-2006
On Wed, 01 Mar 2006 02:34:04 +0100, Stefan Mueller wrote:

> If I click on the first image (mypic1.gif) and then press once theTab key
> the focus is not going to the next checkbox within Internet Explorer. With
> Mozilla Firefox it's working already the first time.
>
> <html>
> <body>
> <img src= 'mypic1.gif' tabindex = '0'>
> <input type = 'checkbox'>
> <p>
> <img src= 'mypic2.gif' tabindex = '0'>
> <input type = 'checkbox'>
> </body>
> </html>
>
> Is there any possibility to tell Internet Exporer also to jump to the next
> checkbox if the Tab key is pressed only once?


I've never used tabindex, but if it does what a similar construct does in
the databas front ends I've used, you should probably set each tabindex
value to different number.


--
Blinky
Killing all posts from Google Groups
The Usenet Improvement Project: http://blinkynet.net/comp/uip5.html

 
Reply With Quote
 
 
 
 
wayne
Guest
Posts: n/a
 
      03-01-2006
Blinky the Shark wrote:
> On Wed, 01 Mar 2006 02:34:04 +0100, Stefan Mueller wrote:
>
>
>>If I click on the first image (mypic1.gif) and then press once theTab key
>>the focus is not going to the next checkbox within Internet Explorer. With
>>Mozilla Firefox it's working already the first time.
>>
>> <html>
>> <body>
>> <img src= 'mypic1.gif' tabindex = '0'>
>> <input type = 'checkbox'>
>> <p>
>> <img src= 'mypic2.gif' tabindex = '0'>
>> <input type = 'checkbox'>
>> </body>
>> </html>
>>
>>Is there any possibility to tell Internet Exporer also to jump to the next
>>checkbox if the Tab key is pressed only once?

>
>
> I've never used tabindex, but if it does what a similar construct does in
> the databas front ends I've used, you should probably set each tabindex
> value to different number.
>
>

In the order you want the tabs to move.

--
Wayne
http://www.glenmeadows.com
 
Reply With Quote
 
Stefan Mueller
Guest
Posts: n/a
 
      03-01-2006
>> I've never used tabindex, but if it does what a similar construct does in
>> the databas front ends I've used, you should probably set each tabindex
>> value to different number.
>>
>>

> In the order you want the tabs to move.


I use tabindex = '0' so that the Tab sequence is from top to down (left to
right). If I use
<html>
<body>
<img src= 'mypic.gif' tabindex = '1'>
<input type = 'checkbox' tabindex = '2'>
<p>
<img src= 'mypic.gif' tabindex = '3'>
<input type = 'checkbox' tabindex = '4'>
</body>
</html>
then the Tab sequence would be wrong.

Stefan


 
Reply With Quote
 
Benjamin Niemann
Guest
Posts: n/a
 
      03-01-2006
Stefan Mueller wrote:

> If I click on the first image (mypic1.gif) and then press once theTab key
> the focus is not going to the next checkbox within Internet Explorer. With
> Mozilla Firefox it's working already the first time.
>
> <html>
> <body>
> <img src= 'mypic1.gif' tabindex = '0'>
> <input type = 'checkbox'>
> <p>
> <img src= 'mypic2.gif' tabindex = '0'>
> <input type = 'checkbox'>
> </body>
> </html>
>
> Is there any possibility to tell Internet Exporer also to jump to the next
> checkbox if the Tab key is pressed only once?


IMG element don't have a TABINDEX attribute and there's no defined meaning
for 'give focus to an IMG element'. Firefox give focus to the first INPUT
element on the first press of tab - it should be irrelevant that you
clicked on the image, though it might be necessary to click somewhere in
the document.

What do you really want?

Should the checkbox be toggled by clicking on the image?
This can be done by wrapping the IMG and the INPUT in a LABEL element:

<label>
<img src= 'mypic1.gif'>
<input type = 'checkbox'>
</label>

Or (in more complex layouts where the IMG and INPUT are not directly
adjacent):

<label for="box1"><img src= 'mypic1.gif'></label>
<input id="box1" type = 'checkbox'>

Should the checkbox just get focus when the image is clicked, but the state
should not change?
Might be done with JavaScript, but such a solution would be as unreliable as
JavaScript.

If you need the TABINDEX attribute (which is only needed, when the tab order
order is different from the source order), put it on the INPUT element. A
TABINDEX of 0 is the default and equal to no explicit TABINDEX attribute at
all.

--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
 
Reply With Quote
 
Stefan Mueller
Guest
Posts: n/a
 
      03-03-2006
> What do you really want?
>
> Should the checkbox be toggled by clicking on the image?
> This can be done by wrapping the IMG and the INPUT in a LABEL element:



Yes, the checkbox should be toggled by clicking on the image. I need that to
color the checkbox. Please see the example on
http://nrkn.com/customCheck/

Therefore I'd like to reach the image also by pressing the Tab key.
With your code <label>...</label> the image never gets the focus even not
with Internet Explorer and Mozilla.

Stefan


 
Reply With Quote
 
Benjamin Niemann
Guest
Posts: n/a
 
      03-03-2006
Stefan Mueller wrote:

>> What do you really want?
>>
>> Should the checkbox be toggled by clicking on the image?
>> This can be done by wrapping the IMG and the INPUT in a LABEL element:

>
>
> Yes, the checkbox should be toggled by clicking on the image. I need that
> to color the checkbox. Please see the example on
> http://nrkn.com/customCheck/
>
> Therefore I'd like to reach the image also by pressing the Tab key.
> With your code <label>...</label> the image never gets the focus even not
> with Internet Explorer and Mozilla.


IMG are not supposed to be interactive elements that can get focus (except
for an IMG inside of a BUTTON perhaps). That's why the browser will not
give it focus via tab, no matter how much you try.
If I would not think that your approach (emulating existing elements for the
sake of some pretty colors) is at least a bad idea, I could suggest that
you try using an INPUT with an image as SRC that can get focus...

--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
 
Reply With Quote
 
Stefan Mueller
Guest
Posts: n/a
 
      03-04-2006
Okay, thanks a lot for your information and your hints.

Stefan


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to tell if cursor is sqlite.Cursor or psycopg2.Cursor dmaziuk Python 3 01-25-2011 04:52 AM
Re: Canon XT - doing full press without wating at half-press Ray Fischer Digital Photography 0 10-24-2010 06:06 AM
How to make cursor auto tab to next textfield? tianyiny@gmail.com Java 1 02-24-2007 05:57 AM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
CurrentElement->next = CurrentElement->next->next (UNDEFINED?) Deniz Bahar C Programming 2 03-09-2005 12:45 AM



Advertisments