Upload widget inside form widget

1 Answer 407 Views
Form Upload
Robert
Top achievements
Rank 1
Robert asked on 09 Sep 2021, 10:52 AM

How to add upload widget inside form widget.

Like the combobox in the sample of forms. I need to put upload file inside the form.

 

thanks.

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 14 Sep 2021, 07:12 AM

Hello, Robert,

The Upload can be added to the Kendo Form via adding a custom editor.  For example, please take a look at this Dojo example which shows one way it can be implemented:

    <form id="form"></form>
      $(document).ready(function () {
        $("#form").kendoForm({
          formData: {
            files: "",
          },
          items: [{
            field: "files",
            label: "files:",
            editor: function(container, options) {
              $('<input type="file" name="' + options.field + '" id="' + options.field + '"/>').appendTo(container)
                .kendoUpload({
                  async: {
                    saveUrl: "save",
                    removeUrl: "remove",
                    autoUpload: true
                  }
              	});
            },
            validation: { required: true }
          }],
        });
      });

Additionally, there is a feature request so you can cast your vote for it to increase the priority to be included in future releases.  Please feel free to follow the request, and leave any comments within the thread.

Please let me know if you have any questions.

Regards,
Martin
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Form Upload
Asked by
Robert
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or