Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Invoke Pre-Save Event through javascript

Avatar

Former Community Member

Hi All,

Isit possible to invoke pre-save event through javascript program instead of manually selecting save button of Adobe Reader ???

Regards,

Ali

5 Replies

Avatar

Level 8

Only through batch or console events (ie not with JavaScript in the form itself).

Kyle

Avatar

Level 7

Maybe there's a logic solution to your problem. Is there something else that the user HAS to do before saving the form? i.e., entering/exiting a field? Maybe you could force that javacript to occur when the user exits certain fields?

e.g., you have a form with 3 subforms in it. Each subform has 5 or 6 fields. Once you exit the last field of a subform, you want a script to run because you know the next step is probably for the user to save the form. Or once the user exits the next to last field on the form, you want to sum the columns somewhere else on the form--something you would do right before the user saves the form.

I don't think I can offer advice that is more clear without some specifics of your form.

Avatar

Former Community Member

Let me Eloborate my problem it might help to shed some light by you guys.

My form will have number of fields one among them i need to fill it automatically through external server which occurs with invocation of RestFul Webservice.As for as i know restfull webservice invocation is possible via pre-save event(Correct me if my understanding is wrong is there any other event supports ???).

So i am trying to initiate pre-save event only for one particular field allowing the user to fill other fields.

Regards,

Ali

Avatar

Level 7

I'll be honest, I have not used REST at all. (Something I should probably remedy.) So, I can't offer you any solid advice.

I found this article about REST requests. It doesn't exactly address what you're doing, but it seems to say that you can invoke a rest request from a button.

If it were something I know about. I would recommend taking your form, saving a copy somewhere else so that you can experiment on it rather than the original. Add a button and place the code you currently have under "pre-save" on the "mouseUp" event for that button.

If it works, great. Pretty it up and maybe change the name on the button to "verify address" or something appropriate for whatever those fields do. Then show whomever you need to so you can change the original.

If it doesn't work, well, then I have no idea.

Avatar

Former Community Member

Hi Jaso,

Thank you so much . It helped me

Ali