Expand my Community achievements bar.

How to call Pre Execute event

Avatar

Level 1

Hi

I am trying out a Proof of concept using Adobe Reader Extended PDF invoking web services. I am able to invoke the web service and get data back in the PDF form. Now the issue is that there are some fields which are mandatory on the form and need to be validated before the web service is executed. I don't see a preExecute event in the list of Javascript events associated with the button.

Is there any way to make sure that all the mandatory fields are filled and then only invoke the web service.

Thanks

Parag

2 Replies

Avatar

Level 10

Hi Parag,

You'll have to write some script in the click event of your submit button to do the mandatory field validation before calling the webservice.

The preExecute has to be entered in the XML source view of the form, but there is no cancel option so you will need to do your validation before that.

John Brinkman recently had a blog about this, http://blogs.adobe.com/formfeed/2009/10/populate_a_listbox_from_a_web.html.  He's also developed a validation library which may help.

Bruce

Avatar

Level 1

Thanks Bruce

I used a workaround to invoke form validation before the execute by adding another regular button which did the validation part and then invokes the execute. Also made the actual execute button hidden.

The code on the regular button click is as follows

if(form1.execValidate())

{

   xfa.resolveNode("PostButton").execEvent("click");

}

Thanks

Parag