This is a migrated thread and some comments may be shown as answers.

Html Label tag for NumericTextBox

3 Answers 223 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
Jaap
Top achievements
Rank 2
Jaap asked on 10 Sep 2012, 08:07 AM
Hello, I'm adding Label tags for all input controls.

This works for almost all input controls, even for a dropdown, although I didn't expect that because the original input element is not visible in that case.

But in the case of a NumericTextBox, the original input element is also not visible, but the label does not work.

See this fiddle: http://jsfiddle.net/JaapM/d4Y7x/

Any clues?



Thanks, Jaap

3 Answers, 1 is accepted

Sort by
0
Jaap
Top achievements
Rank 2
answered on 10 Sep 2012, 09:58 AM
I found that placing the input control inside the label tag works fine. This is even better, because I now don't need to generate id's for the controls. See http://jsfiddle.net/d4Y7x/4/



Regards, Jaap
0
beauXjames
Top achievements
Rank 2
answered on 14 Feb 2013, 05:18 PM
One really shouldn't have to pack a label with anything other than text. It'll really screw with any accessibility tools for one. Secondly, I find it a problem as well. In my situation, I am bringing attention on focus to the control as well as the label...all goes well until I hit a Kendo UI component and since I don't have control over the id of the magically generated 'input' element with the default properties of the control, I can't access my existing logic and these instances must be handled separately.

0
Georgi Krustev
Telerik team
answered on 19 Feb 2013, 03:28 PM
Hello,

 
The NumericTextBox does not set id attribute to the input element used to hold formatted value. As it has more complex rendering then a normal input element, you will need to add specific id to the visible input and wire the label to it. As you said you will need to handler each widget separately.

I will suggest you share your thoughts in a uservoice item If you need additional control over generated html through widget's options.

All the best,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
NumericTextBox
Asked by
Jaap
Top achievements
Rank 2
Answers by
Jaap
Top achievements
Rank 2
beauXjames
Top achievements
Rank 2
Georgi Krustev
Telerik team
Share this question
or