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

ComboBox does not always initialize correctly after empty select tag

2 Answers 171 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Fred
Top achievements
Rank 1
Fred asked on 20 Jan 2014, 05:56 PM
I have found a problem in the loading of the KendoUI Web ComboBox in some cases where a preceding HTML tag is empty, with no close tag.  Here is a jsfiddle showing the problem: http://jsfiddle.net/fwyeadon/q5h3X/8/

The sample contains several ComboBox controls used to accept selection criteria from the user, each placed within a div element.  When run, alert boxes are displayed at the time the first ComboBox, the div containing the second ComboBox, and the second ComboBox are loaded.  The first ComboBox loads and displays fine.  However, the second div and ComboBox do not load correctly, and do not display as a result.  It appears that the DOM elements are loaded, but the kendoComboBox settings are not.

I have found that this problem occurs only when the select element for the first ComboBox is written as an empty tag, as follows.

<select id="_cbSCField_test"/>
or
<select id="_cbSCField_test">

When the above select element is coded with an end tag, the problem disappears.

<select id="_cbSCField_test"></select>

I thought at first this might be a browser-specific problem, but it occurs on current Chrome, IE, and Firefox versions.  The error is somewhat inconsistent, as I have more complex examples along the lines of the jsfiddle sample that work fine.  It is a problem that is easy to work around once you diagnose it, but can be very difficult to find -- especially given that empty tags like the above are perfectly valid HTML5.

Please let me know if this is a bug, and if so when you will fix it.

Regards,
Fred

2 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 22 Jan 2014, 02:42 PM
Hello Fred,

A self-closing SELECT element is considered as invalid HTML. Here I prepared a simple jsBin demo and the W3 validator reports that SELECT element is not defined correctly.

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
Fred
Top achievements
Rank 1
answered on 22 Jan 2014, 05:11 PM
Hi Georgi,

Thanks for the response, I am in recovery from earlier HTML implementations with much looser syntax enforcement.  Void select elements in HTML are still quite common, and I think it was the inconsistent of my test results that led me to see this as a problem.  We have other web pages that use the kendoComboBox in almost exactly the same way with void select elements that do not raise any runtime errors for some reason.  Nevertheless, I will form the habit of using the validator routinely for these cases.

Regards,
Fred

Tags
ComboBox
Asked by
Fred
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Fred
Top achievements
Rank 1
Share this question
or