pop warning to save

Community Beginner ,
Feb 24, 2021 Feb 24, 2021

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 ?

 

TOPICS
PDF forms

Views

64

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Most Valuable Participant ,
Feb 24, 2021 Feb 24, 2021

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();
}

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 24, 2021 Feb 24, 2021

Copy link to clipboard

Copied

When i pop that in i get this

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Most Valuable Participant ,
Feb 24, 2021 Feb 24, 2021

Copy link to clipboard

Copied

Try copying the full code, then...

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Feb 25, 2021 Feb 25, 2021

Copy link to clipboard

Copied

LATEST

You doesn't have copied the } at the end.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 24, 2021 Feb 24, 2021

Copy link to clipboard

Copied

I did copy all the code, it just scrolls to the right.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Most Valuable Participant ,
Feb 25, 2021 Feb 25, 2021

Copy link to clipboard

Copied

You didn't. Have a closer look at my original reply, and at the error message.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 24, 2021 Feb 24, 2021

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. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Feb 24, 2021 Feb 24, 2021

Copy link to clipboard

Copied

Use only the Javascript action.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 24, 2021 Feb 24, 2021

Copy link to clipboard

Copied

When i do that i still get the error

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines