?
Solved

Modify this javascript

Posted on 2013-01-04
15
Medium Priority
?
154 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 7
15 Comments
 
LVL 82

Assisted Solution

by:leakim971
leakim971 earned 1000 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 1000 total points
ID: 38744826
0
 

Author Comment

by:zachvaldez
ID: 38744944
I use an asp.net control textbox with mulitiline property.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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
 
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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
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…
Suggested Courses

764 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