ComboBox does not always initialize correctly after empty select tag

3 posts, 0 answers
  1. Fred
    Fred avatar
    4 posts
    Member since:
    Aug 2013

    Posted 20 Jan 2014 Link to this post

    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. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 22 Jan 2014 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. Fred
    Fred avatar
    4 posts
    Member since:
    Aug 2013

    Posted 22 Jan 2014 Link to this post

    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

Back to Top