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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to keep values?

Status
Not open for further replies.

seekxml

Programmer
Nov 19, 2002
1
FI
Hi lads,
here's my page. My.xsl generates textboxes to write text into elements in my.xml. When I click Add row-button it adds a new row (of textboxes) but also wipes all the text I have put in textboxes. Why?

<XML ID=xDoc SRC=&quot;my.xml&quot;></XML>
<XML ID=xStyle SRC=&quot;my.xsl&quot;></XML>

<SCRIPT language=vbscript>
Sub Window_onLoad
xHTML = xDoc.transformNode(xStyle.XMLDocument)
CONTAINER.innerHTML = xHTML
End Sub

Sub Add()
set root = xDoc.documentElement
set curr_node = root.lastChild
set new_node = curr_node.cloneNode(true)
root.appendChild(new_node)
xHTML = xDoc.transformNode(xStyle.XMLDocument)
CONTAINER.innerHTML = xHTML
End Sub
</SCRIPT>

<body>
<div ID=&quot;CONTAINER&quot;></div>
<INPUT TYPE=BUTTON VALUE='Add row' ONCLICK=&quot;VBSCRIPT:Add()&quot; >
</body>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top