- <html>
- <head>
- <title>Dynamic Form</title>
- <script type="text/javascript" >
- function NewTextbox()
- {
- var t = 1;
- newTextbox.innerHTML = newTextbox.innerHTML +"<input type=text name='txt'+ t />"
- }
- </script>
- </head>
- <body bgcolor=#00ff00 alink=blue vlink=blue>
- <form name="form" action="post" method="">
- <input type="button" value="Add New TextBox" onClick="NewTextbox()">
- <div id="newTextbox"></div>
- </form>
- </body>
- </html>
Javascrip-Add new textbox at runtime in your DIV tag
Using javascript function it will add new textboxes on button's click event into your page.


Join the conversation! Your thoughts help the community grow.