Solved

Modify this javascript

Posted on 2013-01-04
15
145 Views
Last Modified: 2013-01-10
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);
}
0
Comment
Question by:zachvaldez
  • 8
  • 7
15 Comments
 
LVL 82

Assisted Solution

by:leakim971
leakim971 earned 250 total points
ID: 38744806
function addTextbox(theBoxID){
 theBox = Document.GetElementById(theBoxID);
 theParent = theBox.parentNode;
 newBox = theBox.CloneNode(true);
newBox.value = "";
 theParent.appendChild(newBox);
}
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 250 total points
ID: 38744826
0
 

Author Comment

by:zachvaldez
ID: 38744944
I use an asp.net control textbox with mulitiline property.
0
 

Author Comment

by:zachvaldez
ID: 38744965
the textbox is also inside a table within a tr,td
0
 
LVL 82

Expert Comment

by:leakim971
ID: 38744969
did you tried the code?
0
 
LVL 82

Expert Comment

by:leakim971
ID: 38744974
0
 

Author Comment

by:zachvaldez
ID: 38745094
It adds the column to the right.
Is it possible that when it adds it adds a row below not across/column. thanks
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 82

Expert Comment

by:leakim971
ID: 38745109
What is your initial question?
If you have additional question please open a new question.
0
 

Author Comment

by:zachvaldez
ID: 38745141
Yeah but it copies to the right.
0
 
LVL 82

Expert Comment

by:leakim971
ID: 38745153
So create a new question, the purpose of this site is to have a database of question with then answer
0
 

Author Comment

by:zachvaldez
ID: 38745175
It will be the same question but with a different flavor.
0
 

Author Comment

by:zachvaldez
ID: 38745183
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
 
LVL 82

Expert Comment

by:leakim971
ID: 38745184
Yes so use a better question title
0
 
LVL 82

Expert Comment

by:leakim971
ID: 38745200
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
 

Author Closing Comment

by:zachvaldez
ID: 38765935
thanks
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now