Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

opposit to removeChild(this.parentNode)

Status
Not open for further replies.

nirvanadesign

Programmer
Mar 3, 2005
11
GB
Hi

i am using removeChild(this.parentNode)to hide a list of dynamic values when clicked

what is the opposite to removeChild() so i can make the values reapear on another event
 

Code:
element.appendChild(element)

Hope this helps,
Dan


The answers you get are only as good as the information you give!

 

Incidentally, have you considered setting the display style property to "none" to hide the values instead of removing them from the DOM tree?

Dan


The answers you get are only as good as the information you give!

 
hi billy

i used that method originally but as my dynamic list is being created through a php recordset loop on the <tr> tag i get a space in the list
 

i used that method originally but ... i get a space in the list

Which method gives you the space? The appendChild method or the style="display:none" method?

Dan



The answers you get are only as good as the information you give!

 
Note that appendChild is not quite the opposite of removeChild. It won't put the child node back in the same place, it will put it at the end. You may want to look for an insertChild method, or use one of the 'Sibling' methods instead. Sounds like too much work, I'd try to get the display thing to work - it should.


Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
this is what i have done so far

(oh i have sorted the style="display:none and its working great)
////////////////////

i have in iframe1
*data list*

choice 1
choice 2
choice 3
choice 4
choice 5

when a choice is clicked (eg choice1)that choice is removed from the list and a text field appears in iframe2 containing a value. if the user makes a wrong choice or wants to change the order of the fields they can dblClick a field and (onDblClick="this.parentNode.parentNode.removeChild(this.parentNode);)which removes the field and moves the next in line up


i want to fire
********
function showfld(i){
parent.iframe1.getElementById(i).style.visibility='visible';
*******

from the same dblclick in order to show the value again from the initial list

is the syntax correct in the above function as i am getting errors
 
Changing the visibility does not remove the item, just makes it invisible. It still takes up space, which is why you're seeing the white space. Change visibility to display and set it to block or none and it should work better.


Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top