Copy link to clipboard
Copied
I have a form where people can make entries and i have a clear form button on it.
Problem is that if a user wants to clear the form i need to have a warning show up that they need to save the form first under a different name. I need a cancel or ok. after the cancel it would go back to the form, after okay it would come up with the option to save and then cancel the form.
Anybody know how i could achieve this ?
Copy link to clipboard
Copied
You can use this code to do it:
if (app.alert("You should first save the file under a new name.",3,1)==1) {
app.execMenuItem("SaveAs");
this.resetForm();
}
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Try copying the full code, then...
Copy link to clipboard
Copied
You doesn't have copied the } at the end.
Copy link to clipboard
Copied
I did copy all the code, it just scrolls to the right.
Copy link to clipboard
Copied
You didn't. Have a closer look at my original reply, and at the error message.
Copy link to clipboard
Copied
What i did was put a button and in the Actions and as you can see i want to run a javascript to warn about saving the file first so i put the action to save as and then clear the form problem is lets say somebody hits the button by mistake and hits cancel to save the file the form get reset so i need to have the javascript so that if somebody doesn't want to save and go back to the form it stops the actions from running.
Copy link to clipboard
Copied
Use only the Javascript action.
Copy link to clipboard
Copied
When i do that i still get the error