Modify this javascript

This function copiies down a textbox. It clones it however, I prefer to get a blank /or no contents of teh copied textbox..

function addTextbox(theBoxID){
 theBox = Document.GetElementById(theBoxID);
 theParent = theBox.parentNode;
 newBox = theBox.CloneNode(true);
 theParent.appendChild(newBox);
}
zachvaldezAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
leakim971Connect With a Mentor PluritechnicianCommented:
0
 
leakim971Connect With a Mentor PluritechnicianCommented:
function addTextbox(theBoxID){
 theBox = Document.GetElementById(theBoxID);
 theParent = theBox.parentNode;
 newBox = theBox.CloneNode(true);
newBox.value = "";
 theParent.appendChild(newBox);
}
0
 
zachvaldezAuthor Commented:
I use an asp.net control textbox with mulitiline property.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
zachvaldezAuthor Commented:
the textbox is also inside a table within a tr,td
0
 
leakim971PluritechnicianCommented:
did you tried the code?
0
 
leakim971PluritechnicianCommented:
0
 
zachvaldezAuthor Commented:
It adds the column to the right.
Is it possible that when it adds it adds a row below not across/column. thanks
0
 
leakim971PluritechnicianCommented:
What is your initial question?
If you have additional question please open a new question.
0
 
zachvaldezAuthor Commented:
Yeah but it copies to the right.
0
 
leakim971PluritechnicianCommented:
So create a new question, the purpose of this site is to have a database of question with then answer
0
 
zachvaldezAuthor Commented:
It will be the same question but with a different flavor.
0
 
zachvaldezAuthor Commented:
First of all it clones it but it also clones the values in the textbox.
For some reasons, this line

newBox.value = "";
  does not clear my values in the textbox copied.
0
 
leakim971PluritechnicianCommented:
Yes so use a better question title
0
 
leakim971PluritechnicianCommented:
Right click on your page, choose view source and post it here. You said it work in your previous post, I would like to know why it suddenly stop working
0
 
zachvaldezAuthor Commented:
thanks
0
All Courses

From novice to tech pro — start learning today.