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

Validation for Dropdown on click of submit is not working for IE9. Screenshot attached.

1 Answer 120 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Azhar
Top achievements
Rank 1
Azhar asked on 22 Feb 2013, 09:51 PM
Hi ,

I have a problem with validation for dropdown on click of submit. The validation triggers in Chrome but IE9 doesnt support, so could any one suggest a work around for IE.

Here is the dropdown UI

<div id="ModalMaterialCodeMappingForm">
    <div class="editor-row" style="padding-bottom: 1em;">
        <div class="selector-type-column">
            @(Html.Kendo().DropDownList().Name("editMappingTerminalSearchTypeDropDownList")
                  .DataTextField("Text").DataValueField("Value").BindTo(Model.TerminalSearchType))
        </div>
        <div class="float-left editor-label" style="width: 80px;">
            @Html.LabelFor(model => model.TerminalName)
        </div>
        <div class="float-left">
            @Html.TextBoxFor(model => model.TerminalName, new {selectedValue = "0", @class = "selector"})&nbsp;<span  style="color:red">*</span><span class="k-invalid-msg" data-for="TerminalName"></span>
        </div>
        <div class="clear"></div>
    </div>

the dropdown is an autocomplete which has a placeholder, if i remove the place holder the validation triggers.

textBoxField.kendoAutoComplete({
        minLength: 1,
        dataTextField: "Value",
        dataValueField: "Key",
        filter: "contains",
        placeholder: placeHolderText
});


I have attached the screenshots.

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 26 Feb 2013, 07:58 PM
Hello,

Internet Explorer(at least before 10) does not support the placeholder attribute. Thus in order to show a placeholder, it is set to the input and the validation will pass since there is a value. If the placeholder is needed then a possible workaround is to implement a custom validation rule which checks whether the value is set and is different then the autocomplete placeholder.

Regards,
Daniel
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
DropDownList
Asked by
Azhar
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or