Solved

Modify this javascript

Posted on 2013-01-04
15
149 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 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Open dialog with server side controls in it 3 48
Can't get page to reload 9 19
ModalPopup  question 22 39
Can anyone help me find this preloader? 51 48
In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…

730 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