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

Preferred usage of <input> vs. <select>?

2 Answers 1409 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
beauXjames
Top achievements
Rank 2
beauXjames asked on 28 May 2015, 05:24 PM

In 'older' code in our system it seemed necessary to use a <select> element at all times when invoking and binding to a kendo ComboBox. Now, we note that there is less variance between using an <input> element and the performance appears to be identical.

I notice that in the dojo, if there exists a fixed set of options and no dataSource, <select> is used and then the element is just initialized as kendoComboBox. On the other hand, any time a dataSource is provided, whether locally or remotely, the dojo uses the <input> element.

When viewed in the source, there seems to be little variance except for the <select>/<input> shown after the k-dropdown-wrap. Both of which are hidden from display anyways.

Do you have any 'input' on this?

2 Answers, 1 is accepted

Sort by
0
Accepted
Georgi Krustev
Telerik team
answered on 29 May 2015, 10:43 AM
Hi,

In general, the widget supports equally <input /> and <select></select> elements. There is only one additional step that the widget does when SELECT element is used and it is a re-generation of the OPTION elements. This is done on every dataSource change. When amount of the rendered data is small, in practice this additional step does not add any performance impact.

When INPUT or SELECT will be used depends entirely on the developer preferences. If he/she wants to provide graceful degradation (when JavaScript is disabled), then it will be better to use SELECT elements with already defined OPTION elements. If this is not required, then just use INPUT element. 

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
beauXjames
Top achievements
Rank 2
answered on 29 May 2015, 03:24 PM
That's a perfect explanation. Exactly what I needed to know. Appreciate your time on the topic.
Tags
ComboBox
Asked by
beauXjames
Top achievements
Rank 2
Answers by
Georgi Krustev
Telerik team
beauXjames
Top achievements
Rank 2
Share this question
or