This question is locked. New answers and comments are not allowed.
Hi,
I need to set a custom value in the onchange event of the combobox, is that possible?
When I select one value in the combobox, I need to set some values to other input fields like above.
Regards,
Mattias
I need to set a custom value in the onchange event of the combobox, is that possible?
@for (var i = 0; i < Model.TenderProducts.Count; i++){ @(Html.Telerik() .AutoComplete() .Name(string.Format("TenderProducts[{0}].ArticleNr", i)) .Encode(false) .BindTo(Model.Products.Select(p => p.ArticleNr)) .AutoFill(false) .HtmlAttributes(new { style="width: 150px" }) .HighlightFirstMatch(true) .ClientEvents(events => events.OnChange("onArticleNrChange")) ) <input type="text" name="AnotherBox" id="AnotherBox_@(i)" value="" />}<script type="text/javascript"> function onArticleNrChange(e, index) { $.getJSON("/admin/tender/getproduct", { articleNr: e.value }, function (json) { //alert(json.Description); document.getElementById('AnotherBox_' + index).value = json.Description; }); }</script>When I select one value in the combobox, I need to set some values to other input fields like above.
Regards,
Mattias