Hi I've created a form that adds a new instance when i click on a button with the click script
"Mysubform.addinstanceManger.addInstance (1);"
This copies my complete form to a new page which is what i want it to do.
However when veiwed in on the web i want to create a delete button that will delete the current page the user is veiwing if they decide they want to.
example if the first form is filled out and they click the add new page and fill out the second form, and click again if they need to fill out another.
If now for example they have now created 4 pages and decide they want to delete say, page 2 or maybe page 3. but keep the other pages with information already entered. How do i create a button that deletes the current page they choose to delete.
Any detaiiled help would be greatly appreciated!!!!!! as i am new to scripting and LC.
Solved! Go to Solution.
Views
Replies
Total Likes
Very odd. I think I got it right this time.
Views
Replies
Total Likes
Take a look at the attached. The form includes a button 'removePageBtn' and the click event is as follows:
// form1.page.subform.removePageBtn::click - (JavaScript, client)
var i = this.parent.instanceIndex;
if (i == 0) {
if (form1.page.instanceManager.count > 1) {
form1.page.instanceManager.removeInstance(0);
}
}
else {
i = i + 1;
form1.page.instanceManager.removeInstance(i);
}
Steve
Views
Replies
Total Likes
Hi Steve thankyou for your help.
I tried your attached form and as a test I added three pages and typed a different name in the name fields for each form to distinguish them appart.
So for example the first form has a name of "Steve", second form has a name of "John" and third form has "Rick",
Now if i go to the second page/form and click "Remove This Page Button" the first form with the name of Steve has been deleted and not the second form of "john" where i clicked the button from. So is it possible to remove the page that i clicked to delete and have the others with their data, remain. ? again any help is appreciated.
Views
Replies
Total Likes
Whoops. Something got busted. It was working. Let me take a look.
Steve
Views
Replies
Total Likes
Very odd. I think I got it right this time.
Views
Replies
Total Likes
Thanks Stevie L you are the man.!!!
works great.
Views
Replies
Total Likes