Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Use submit button to trigger validation and prompt to save instead of submit action

Avatar

Level 8

I want to add a Submit Button that will trigger all validation using the built-in feature. This will also work well with the "forms validation" setting done on the form properties. See snapshot below.

However, if the validation is successful, I want to prompt for the save dialogue box instead actually submitting the form using this line of code:

app.execMenuItem("SaveAs");

How is this possible?

928663_pastedImage_0.png

Tarek

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi there,

to do so you only need to call execValidate function built-in your form using the following :

Hope this will help!

View solution in original post

7 Replies

Avatar

Correct answer by
Level 10

Hi there,

to do so you only need to call execValidate function built-in your form using the following :

Hope this will help!

Avatar

Level 8

Thanks .... the only thing I wanted to implement is to focus on the first field which has errors, which is supported by the form validation. However, I had to manually hard code the call to the function to set focus after the dialogue.

Tarek

Avatar

Level 10

If you'd like to customize your validation in a better way than to use Adobe validation, you can try this functionality for validating forms.

It can be used in any form and easy customization, I hope this can come in any help for you.

Validation / Reset Functions, easy to manipulate and to change Forms!!!!

Avatar

Level 2

Guys,

It gives the popup. We have to manually mention the filename and select the path where we need to save.

Instead of this, will it automatically save the file into the folder. Where can i mention the filename and path in the code.

Avatar

Level 10

Hi there,

if what you want is to specify the filename and path within LiveCycle using JavaScript, unfortunately Adobe will prevent that. To do so I think you need to create a trusted function. This requires a js file to be installed on the computer's user within adobe's JavaScript folder installation.

Avatar

Level 8

To avoid prompting the file name, you have the following options:

1. Use trust function (client-based solution). This requires configuration on the user end. It is acceptable solution if the number of users is small.

2. Use submit to server to save. You can submit to server using Java/Eclipse/Tomcat or ASP.NET/VS/IIS and you have to develop a server side program to retreive the input stream, extract the XML, and parse it to get the data and PDF in binary format. I have done both solution using Java and ASP.NET. This is the best solution, and it requires good knowledge about server based technologies. Click here to find related samples.

2. Use Workbench to develop a process to process submission. I some knowledge about this and developed a few processes to perform this function.

Tarek

Avatar

Level 2

@tarekahf

I am unable to get the sample documents. Could you please share documents to (sivasankaran.ganesan@gmail.com).