Expand my Community achievements bar.

SOLVED

Prevent Double Submission

Avatar

Level 2

Hi Experts,

I have interactive form with submit button, which will call web service if it is clicked.

The issue we had here is that the form doesn't stop the user from clicking the submit button twice (or more than one time).

In result, we got duplicates entries.

Q:

1. Is there a (standard) technique to prevent user to click the submit button again before the form receive any feedback/response from web service? I have tried to disable/hide the submit button until the form receive feedback from web service, but it doesn't work.

Thanks for your time.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

The postSubmit event came in with XFA Specification 2.8 (Acrobat/Reader v9). From John Brinkman's blog:

XFA Specification.png

You could move the script up to the mouseUp event. This fires just before the click event. If this does not suit, you coud try the exit event, but this would not prevent the user from clicking again, before they exit.

Niall

View solution in original post

6 Replies

Avatar

Level 10

Hi,

I am not sure why your approach has not worked. Setting the button's presence to hidden or its access to readOnly would normally work.

What script have you tried? Is the form saved as a Dynamic XML Form?

Niall

Avatar

Level 7

We have a similar  problem....

Recently my company has update the operating system from Windows XP to Windows 7 Pro.

This which happening last time when some users click on the email form button the receptients receive

multiply emails!

Form is a dynamic XML.

Thank you

Avatar

Level 2

Hi Niall,

I am using dynamic xml form and use FormCalc script to make the button invisible/disabled.

Let me elaborate further:

1. I create a new data connection by providing the WSDL file.

2. In the form designer, i drag and drop the submit button

3. In the event "CLICK", i added this statement:   $.presence = "invisible"

4. I have 1 invisible text field in the form and bind it to result of the webservice. If the text field has value, then i make the submit button visible again ($.presence = "visible")

Is my approach correct?

How can you tell if the form has received feedback/response from the webservice?

Thanks.

Avatar

Level 10

Hi,

A standard submit button does not have a click event, in that this event is already used behind the scenes for the submission. If you are adding the script into the XML Source, then this is where you problems may start.

I would place your presence script in the postSubmit event, so that it is on its own and away from the submit script. Do this in the Script Editor and not in the XML Source.

Niall

Avatar

Level 2

Hi Niall,

Spot on.

I make the script in the xml source instead of Script Editor.

But i don't have event "postSubmit" on my submit button (LiveCycle Designer v8.1.2).

button_event.JPG

Please advise.

Avatar

Correct answer by
Level 10

Hi,

The postSubmit event came in with XFA Specification 2.8 (Acrobat/Reader v9). From John Brinkman's blog:

XFA Specification.png

You could move the script up to the mouseUp event. This fires just before the click event. If this does not suit, you coud try the exit event, but this would not prevent the user from clicking again, before they exit.

Niall