Solved

Modify this javascript

Posted on 2013-01-04
15
148 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…

776 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