Set Textbox value in Editor Template from Javascript

2 posts, 1 answers
  1. Robert Madrian
    Robert Madrian avatar
    168 posts
    Member since:
    Apr 2003

    Posted 05 Aug 2016 Link to this post


    I have a grid with a  Editor Template with one TextBox and a Upload Control (see Code)

    in the Upload Control Client Event "Success" I want to set the filename to the TextBox Control - how to Access the TextBox Control in edit mode of the template from this Event?

    @model string
    @using Kendo.Mvc.UI
    @Html.TextBoxFor(model => model, new { @class = "k-textbox" })
                .Messages(m => m.HeaderStatusUploaded("Erfolgreich"))
                .Messages(m => m.Select("Word Dokument hochladen..."))
                //.HtmlAttributes(new { accept = "application/pdf" })
                .Async(a => a
                .Save("Save", "Auszeichnungsart")
             .Events(events => events

    the Javascript Events

    function onUpload(e) {
            //var grid = $("#grid").data("kendoGrid");
   = { Auszeichnungsart_ID: $("#Auszeichnungsart_ID").val() };
        function onUploadSuccess(e) {

        here I want to set the TextBox value of the edit template

            var grid = $("#grid").data("kendoGrid");

  2. Answer
    Eyup avatar
    3320 posts

    Posted 09 Aug 2016 Link to this post

    Hi Robert,

    You can check whether the e argument holds a reference to the Upload DOM element, for example e.sender. Then, you can use it to get the sibling textbox element.

    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top