I have coded the following JavaScript script in the preSubmit event for a submit button that will result in a database deletion.
form1.#pageSet[0].Page1.ButtonAreaTop.DeleteButton::preSubmit:form - (JavaScript, client)
var resp = xfa.host.messageBox("Delete this filing?","Verify",2,2);
if (resp == "4") { xfa.event.cancelAction = false;}
else { xfa.event.cancelAction = true;}
The script works, but because the button is on the Master Pages and the form has multiple pages, the preSubmit event is being invoked as many times as there are pages. So, the user has to answer the same question multiple times. This is a little annoying.
Does anyone have an idea on how I can keep the DeleteButton on the Master Pages and prevent the message box from appearing multiple times (once for every page)?
Solved! Go to Solution.
Views
Replies
Total Likes
Give this a try:
if (Page1.index==0){
var resp = xfa.host.messageBox("Delete this filing?","Verify",2,2);
if (resp == "4") { xfa.event.cancelAction = false;}
else { xfa.event.cancelAction = true;}
}
Kyle
Views
Replies
Total Likes
Give this a try:
if (Page1.index==0){
var resp = xfa.host.messageBox("Delete this filing?","Verify",2,2);
if (resp == "4") { xfa.event.cancelAction = false;}
else { xfa.event.cancelAction = true;}
}
Kyle
Views
Replies
Total Likes
Kyle:
That worked!
Thank you!
John
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies