473,387 Members | 1,391 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

cloneNode just under cloned element

25
hello, i need help with this javascript
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2.  
  3. function addfile()
  4. {
  5. var obj = document.getElementById("sprytextfield2").cloneNode(true);
  6. document.body.appendChild(obj);
  7. }
  8.  
  9. </script>
and i want to change it somehow to copy my form input just under it.
not to the body of document.

here is the rest of code
Expand|Select|Wrap|Line Numbers
  1. <fieldset class="border" id="upfiles">
  2.         <legend>Vymazať fotku v profile pod albumom:</legend>
  3.         <label for="pod_albumom_photo_id[]">ID fotky:</label><br />
  4.         <span id="sprytextfield2">
  5.         <input type="text" name="pod_albumom_photo_id[]" value="" onKeyPress="ipt_onkeypress()" />
  6. <span class="textfieldInvalidFormatMsg">Iba cifry prosím. </span></span>
  7. <input
  8. class="button"
  9. type="button"
  10. value="Pridať pole"
  11. onclick="return addfile()" />
  12.  
  13.  
  14.         </fieldset>
  15.  
Aug 6 '09 #1
2 1994
Canabeez
126 100+
can't you just append it to the fieldset?
Expand|Select|Wrap|Line Numbers
  1. function addFile(){
  2. var obj = document.getElementById("sprytextfield2").cloneNode(true);
  3. document.getElementById('upfiles').appendChild(obj);
  4. }
  5.  
Aug 6 '09 #2
Alino
25
omg, it works, i was so stupid, i already tried that but didn't use quotations on upfiles. Thanks :D
Aug 6 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: johkar | last post by:
This is a shortened version of my problem. Below I am cloning the first data row and appending it to create a new row. If you make selections/add values and then press Add Row, the text box value...
1
by: MonkeyBoy | last post by:
I am doing some some HTML manipulation in client-side script (IE5.x and IE6.x browsers only). Something like.. var tmpHTML = oTable.outerHTML // do something to the HTML her oTable.outerHTML =...
7
by: garthb | last post by:
Hello, In Mozilla (Firefox 1.0.7) I can cloneNode a file input element that has a selected file value and appendChild it to another form without a problem. IE 6 loses the selected file value....
4
by: chippy | last post by:
I am finding that when I use the cloneNode method to copy an HTML element that contains a <script> tag, the contents of the <script> tag, (ie. the javascript) are removed. If I do this: var...
0
by: Sullivan WxPyQtKinter | last post by:
Hi, I am now using minidom for my current development. I use cloneNode method in Element object, but it just does not work. The test code is very simple as follows: =========CODE==============...
1
by: jaktharkhan | last post by:
Hi, I really really need help in trying to figure out how can I do a CloneNode on an Iframe where the cloned IFRAME clones with all its contents?. Basically what I am doing is dynamically building...
1
by: bs9999 | last post by:
Can someone please tell me why when i use <object>.clondeNode that when I appendChild it to my document, the new node doesnt properly work? I'm making a clone of a <scriptand <linknode from an...
1
by: Janis Papanagnou | last post by:
While testing a JavaScript application that uses 'cloneNode(true)' I noticed that actual _values_ of radio buttons are not cloned with MS IE but are cloned with FF. Does somebody know whether that...
4
by: Olorin | last post by:
Hello everyone. I'm playing around with some AJAX-ish stuff and encountered some problem in the JS side of the universe. Maybe someone here can suggest an alternative that works. I have...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.