Thursday, May 23, 2024
 Popular · Latest · Hot · Upcoming
77
rated 0 times [  78] [ 1]  / answers: 1 / hits: 19314  / 14 Years ago, sat, august 21, 2010, 12:00:00

The site is here



I have opt to using the radiobutton's labels as customized buttons for them. This means the radio inputs themselves are display:none. Because of this, the browsers don't tab stop at the radio labels, but I want them to.



I tried forcing a tabindex to them, but no cigar.



I have came up with just putting a pointless checkbox right before the labels, and set it to width: 1px; and height 1px; which seems to only really work on chrome & safari.



So do you have any other ideas for forcing a tab stop at those locations without showing an element?



Edit:



Just incase someone else comes by this, this is how I was able to insert small checkboxes into chrome & safari using JQuery:



if ($.browser.safari) {
$(label[for='Unlimited']).parent().after('<input style=height:1px; width:1px; type=checkbox>');
$(label[for='cash']).parent().after('<input style=height:1px; width:1px; type=checkbox>');
$(label[for='Length12']).parent().after('<input style=height:1px; width:1px; type=checkbox>');
}


Note: $.browser.webkit was not becoming true...so I had to use safari


More From » html

 Answers
4

Keep the radio input hidden, but set tabindex=0 on the <label> element of reach radio input.



(A tab index of 0 keeps the element in tab flow with other elements with an unspecified tab index which are still tabbable.)


[#95856] Tuesday, August 17, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rossj

Total Points: 606
Total Questions: 100
Total Answers: 116

Location: Dominican Republic
Member since Sun, Sep 4, 2022
2 Years ago
rossj questions
Mon, Sep 13, 21, 00:00, 3 Years ago
Thu, Jun 17, 21, 00:00, 3 Years ago
Sun, Nov 22, 20, 00:00, 4 Years ago
Thu, Sep 3, 20, 00:00, 4 Years ago
Sun, Aug 2, 20, 00:00, 4 Years ago
;