Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can I add a row 0f 6 textboxes dynamically using javascript? Please give me a code snippet.

Thank You
Posted
Comments
Nilesh Patil Kolhapur 3-May-12 0:45am    
please improve your Question

You can use createElement and appendChild methods of javascript. Please look at following links these will be very useful for you to accomplish your task.

http://www.roseindia.net/javascript/method-createelement.shtml[^]

http://reference.sitepoint.com/javascript/Document/createElement[^]

http://www.adp-gmbh.ch/web/js/elements/createelement.html[^]

Regards
Praveen
 
Share this answer
 
Can I add a row 0f 6 textboxes dynamically using javascript
Yes.

Please give me a code snippet.
JavaScript
var txtBox = document.createElement('input');
txtBox.type = "text";
//... Add any more properties to the textbox
rowToAdd.appendChild(txtBox);


Look here, two different ways to add it dynamically:
Dynamically add button, textbox, input, radio elements in html form using JavaScript.[^]
Dynamically Adding and Removing Text Boxes using JavaScript[^]
 
Share this answer
 
Comments
maajanes 3-May-12 3:41am    
Hai sandeep,
Thank you for your reply. But I have to add multiple row of textboxes by a button click. Please help
Sandeep Mewara 3-May-12 4:34am    
So what! Do it. Code snippet holds true for multiple rows too. Don't sound as if you need the exact code to copy-paste!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900