Kendo UI ComboBox Validate Input to List
Kendo UI ComboBox that validates the input value to the items in the selection list.
by chanaka1
HTML
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.2.710/styles/kendo.common.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.2.710/styles/kendo.default.min.css">
<script src="http://cdn.kendostatic.com/2012.2.710/js/kendo.all.min.js"></script>
<input id="d1" class="customerComboBox"></input>
CSS
.customerComboBox {
width: 100%;
}
.customerList {
width: 500px !important;
}
.customerId, .customerName {
display: inline-block;
}
.customerId {
width: 75px;
}
.error {
background-color: Pink;
}
JavaScript
$("#d1").kendoComboBox({
dataSource: {
type: "odata",
transport: {
read: "http://services.odata.org/Northwind/Northwind.svc/Customers"
}
},
filter: "contains",
dataTextField: "CustomerID",
dataValueField: "CustomerID"
}).data("kendoComboBox");