Quantcast
Channel: Adobe Community : All Content - LiveCycle Designer
Viewing all articles
Browse latest Browse all 5571

Script to remove all rows in a table except the first

$
0
0

Please see the screenshots for the question/radio button I'm scripting.  If "No" is clicked I would like it to delete all rows except the first one.  So if the user first clicks Yes, adds a bunch of rows and then clicks No, I want all the extra rows to be deleted.  I'm using the script below but it only deletes half of the rows at a time.  I have to click No 2-3 times to delete all the rows.  Greatly appreciate any help!

 

// remove extra rows that may have been added
var rowCount = Page2.UserList.Table1._RowUserName.count;
for (var i=0; i<rowCount; i++) {  Page2.UserList.Table1._RowUserName.removeInstance(i);
}

 

LCD1.png

 

lCD2.png


Viewing all articles
Browse latest Browse all 5571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>