Combobox Placeholder breaks page layout

2 posts, 0 answers
  1. Dan
    Dan avatar
    16 posts
    Member since:
    Aug 2014

    Posted 29 Aug 2014 Link to this post

    I have an input element that I am using as a ComboBox, which works great:

    <input id="imtSelect" name="IMT" required data-required-msg="IMT is required." data-bind="value: imt">

    I have it configured down in the "function" part of the page I am working on:
    var imtData = [ "US", "Canada", "Federal" ];
    // create ComboBox for IMT...
        dataSource : imtData,
        index : 0

    However, if I try to add the "placeholder" attribute to the combobox, it throws/breaks all formatting on the page.  The TabStrip, the other comboboxes, date pickers --- basically the styles/classes are no longer in effect.

    Here is what I change it to:
        dataSource : imtData,
        index : 0
        placeholder : "Select..."

    I have also tried to define this attribute in the input element itself (placeholder="Select..."), but it has no effect -- it does not appear in the combobox.

    Not sure what I am doing incorrect.

  2. Georgi Krustev
    Georgi Krustev avatar
    3687 posts

    Posted 02 Sep 2014 Link to this post

    Hello Dan,

    The code snippet that adds the placeholder option has a missing comma:
    index : 0 [here]
    placeholder : "Select..."
    This is invalid JavaScript and the widget will not initialize and every JavaScript widget after this declaration. Please add the missing comma and let me know if the problem still persists:
        dataSource : imtData,
        index : 0,
        placeholder : "Select..."

    Georgi Krustev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top