I have a table with row 1 visible and row 2 that appears when the "Add a New Row" button is clicked. If the user clicks the "Delete Last Row" button, the last row is deleted. I want the "Delete Last Row" button to only be visible when there is more than one row visible.
This script does not work:
if (Page1.Subform2.Table1._Row2.count =< 1){
this.presence = "visible";
}
else {
this.presence = "invisible";
}
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
Is this a code fragment from the click event of the "Delete Last Row" button?, I think you just need to swap the "=<" to "<=", this should have given you a syntax error, or is this just from getting the code into the forum?,
Anyway, try this in the delete button click event;
Page1.Subform2.Table1._Row2.removeInstance(Page1.Subform2.Table1._Row2.count - 1);
if (Page1.Subform2.Table1._Row2.count <= 0)
{
this.presence = "invisible";
}
and this in the add button click event;
Page1.Subform2.Table1._Row2.addInstance(true);
if (Page1.Subform2.Table1._Row2.count > 0)
{
DeleteLastRow.presence = "visible";
}
Bruce
Views
Replies
Total Likes
Hi,
Is this a code fragment from the click event of the "Delete Last Row" button?, I think you just need to swap the "=<" to "<=", this should have given you a syntax error, or is this just from getting the code into the forum?,
Anyway, try this in the delete button click event;
Page1.Subform2.Table1._Row2.removeInstance(Page1.Subform2.Table1._Row2.count - 1);
if (Page1.Subform2.Table1._Row2.count <= 0)
{
this.presence = "invisible";
}
and this in the add button click event;
Page1.Subform2.Table1._Row2.addInstance(true);
if (Page1.Subform2.Table1._Row2.count > 0)
{
DeleteLastRow.presence = "visible";
}
Bruce
Views
Replies
Total Likes
Thanks for your help!
Views
Replies
Total Likes