This is a migrated thread and some comments may be shown as answers.
Add a textbox by clickink a button
1 Answer 15 Views
This is a migrated thread and some comments may be shown as answers.
anna caroline silva dos
Top achievements
Rank 1
anna caroline silva dos asked on 04 Nov 2020, 08:58 PM



Is it possible to add a textbox dinamically, by clicking a button?

I have the following code, and I need to add a textbox, just like the one I already have when click the "Add Button"


01.<!DOCTYPE html>
04.    <meta charset="utf-8"/>
05.    <title>Kendo UI Snippet</title>
09.    <script src=""></script>
15.    <div>
16.      <input id="textbox" style="width: 100%;" />
17.      <input type="button" id="add" value="Add TextBox" class="k-button"/>
18.    </div>
19.    <script>             
20.                $(document).ready(function () {
21.           $("#textbox").kendoTextBox({
22.               placeholder: "",
23.                label: {
24.                    content: "Email",
25.                    floating: true
26.                }
27.             });
28.          })
29.    </script>

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 05 Nov 2020, 12:02 PM

Hi, Anna,

thank you for sharing your code.

What you are looking for can be done with a jQuery event:

  1. add a click event listener to the button
  2. manipulate the DOM to create and add a new input field to the HTML body with every click.
  3. initialize the kendo TextBox widget like you have done 

Note that you must append the input to the body

 before you initialize the Text Box

or it will initialize incorrectly. Here is an example:

If you are interested I recommend this tutorial on jQuery events.

I hope to have cleared up the topic. Please don't hesitate to reach out if you have any additional Kendo UI inquiries.

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

Asked by
anna caroline silva dos
Top achievements
Rank 1
Answers by
Telerik team
Share this question