Reset repeating table back to nothing

P

Patrick Temple

So I have a button that adds rows to the table for users but I want to be
able to clear out all that data as well and effectively reset the repeating
table back to a single row of blank data.

I assuming this has to be done with JavaScript code, so if anyone has an
example that would be great. If not, perhaps you could point me to some
online help for JavaScript and XML that could help me along.

Thanks
--Patrick Temple
--Adecco Technical
 
S

S.Y.M. Wong-A-Ton

Clearing out a repeating table is a matter of looping through all the nodes
of the XML of the repeating table and resetting the values of the fields in
each row. To delete all rows, you need to loop through all the nodes of the
XML of the repeating table and use removeChild() on the parent of each row.
To add a single row of blank data you must create the XML node representing a
row and then use the appendChild() method on the parent to which you want to
add the child node. Search this newsgroup for examples of usage of the two
aforementioned methods.

To learn more about JScript go to http://www.microsoft.com/scripting
To learn more about XML try http://www.w3schools.com/xml/default.asp

You can also check out my website for InfoPath-related JScript examples:
http://enterprise-solutions.swits.net/infopath/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top