Hi
I have placed a reset button on my form. Now I want the user to choose whether to reset the form or not. I can make the message box come up with the right buttons, but I don’t know how to adjust the script to actually not reset the form when choosing NO.
I have placed this script on my reset button.
xfa.host.messageBox("Are you sure you want to erase ALL data on this form and start over?","Reset Titel",1,2)
xfa.host.resetData();
xfa.form.remerge();
Kirstine
Views
Replies
Total Likes
You can use the return value of the messageBox function to check whether user has selected Yes / No..
if(xfa.host.messageBox("Are you sure you want to erase ALL data on this form and start over?","Reset Title",2,2) == "4"){
xfa.host.resetData();
xfa.form.remerge();
}
Thanks
Srini
Views
Replies
Total Likes
Hi Srini
It works perfect!
Then I have an additional question because I'll like to understand why it works.
I hope you will take the time to explain the details.
Regards
Kirstine
Views
Replies
Total Likes
Since you are asking user to make a decision to reset data, it would be better to display a Question icon instead of Information icon.
MessageBox is a function which returns a response back. So in your code, 4 is returned when you select "Yes" button in the messageBox window..
Hope this helps..
Thanks
Srini
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies